From 8f6a3e187785a27ca6918fbe2b082047271c3693 Mon Sep 17 00:00:00 2001 From: PatrickAlphaC Date: Fri, 18 Oct 2024 08:50:45 +0000 Subject: [PATCH] deploy: 3487e1db763c7449f210355d5dfa8c3ae93cc96b --- .buildinfo | 4 + .nojekyll | 0 _images/mark.svg | 1 + _sources/all_moccasin_toml_parameters.rst.txt | 111 ++ .../api_reference/config_reference.rst.txt | 7 + .../moccasin_account_reference.rst.txt | 7 + .../named_contract_reference.rst.txt | 7 + .../api_reference/network_reference.rst.txt | 7 + .../api_reference/networks_reference.rst.txt | 7 + _sources/class_reference.rst.txt | 13 + _sources/cli_commands.rst.txt | 16 + _sources/cli_reference/compile.rst.txt | 7 + _sources/cli_reference/config.rst.txt | 7 + _sources/cli_reference/console.rst.txt | 7 + _sources/cli_reference/deploy.rst.txt | 7 + _sources/cli_reference/deployments.rst.txt | 7 + _sources/cli_reference/explorer.rst.txt | 7 + _sources/cli_reference/init.rst.txt | 7 + _sources/cli_reference/inspect.rst.txt | 7 + _sources/cli_reference/install.rst.txt | 7 + _sources/cli_reference/purge.rst.txt | 7 + _sources/cli_reference/run.rst.txt | 7 + _sources/cli_reference/test.rst.txt | 7 + _sources/cli_reference/wallet.rst.txt | 7 + _sources/common_errors.rst.txt | 7 + _sources/core_concepts/dependencies.rst.txt | 137 ++ .../dependencies/purging.rst.txt | 38 + .../dependencies/virtual_environments.rst.txt | 83 + _sources/core_concepts/deployments.rst.txt | 90 ++ _sources/core_concepts/moccasin_toml.rst.txt | 102 ++ .../core_concepts/named_contracts.rst.txt | 141 ++ .../named_contracts/manifest_contract.rst.txt | 128 ++ _sources/core_concepts/networks.rst.txt | 52 + _sources/core_concepts/networks/eravm.rst.txt | 18 + .../networks/forked_networks.rst.txt | 45 + _sources/core_concepts/networks/pyevm.rst.txt | 37 + _sources/core_concepts/project.rst.txt | 46 + _sources/core_concepts/script.rst.txt | 152 ++ .../core_concepts/scripting/console.rst.txt | 10 + .../core_concepts/scripting/deploy.rst.txt | 51 + _sources/core_concepts/testing.rst.txt | 47 + .../core_concepts/testing/coverage.rst.txt | 38 + .../core_concepts/testing/fixtures.rst.txt | 55 + .../testing/gas_profiling.rst.txt | 34 + .../core_concepts/testing/pranking.rst.txt | 13 + .../testing/staging_markers.rst.txt | 81 + .../testing/titanoboa_testing.rst.txt | 8 + _sources/core_concepts/wallet.rst.txt | 95 ++ .../core_concepts/wallet/config_keys.rst.txt | 13 + .../core_concepts/wallet/private_key.rst.txt | 9 + _sources/explorer_network_defaults.rst.txt | 4 + _sources/how-tos/verify_contracts.rst.txt | 47 + _sources/index.rst.txt | 92 ++ _sources/installing_moccasin.rst.txt | 197 +++ _sources/quickstart.rst.txt | 144 ++ _sources/toctree.rst.txt | 53 + .../tutorials/zksync-getting-started.rst.txt | 52 + _static/basic.css | 914 +++++++++++ _static/check-solid.svg | 4 + _static/clipboard.min.js | 7 + _static/compile-stats.png | Bin 0 -> 74177 bytes _static/copy-button.svg | 5 + _static/copybutton.css | 94 ++ _static/copybutton.js | 248 +++ _static/copybutton_funcs.js | 73 + _static/docs-logo.png | Bin 0 -> 12602 bytes _static/doctools.js | 149 ++ _static/documentation_options.js | 13 + _static/favicon.svg | 5 + _static/file.png | Bin 0 -> 286 bytes _static/gh_banner.png | Bin 0 -> 26885 bytes _static/how-to-kill.png | Bin 0 -> 57307 bytes _static/language_data.js | 192 +++ _static/mark.svg | 1 + _static/minus.png | Bin 0 -> 90 bytes _static/moccasin_logo.png | Bin 0 -> 6593 bytes _static/moccasin_logo.svg | 12 + _static/plus.png | Bin 0 -> 90 bytes _static/print.css | 42 + _static/pygments.css | 1 + _static/searchtools.js | 632 ++++++++ _static/shibuya.css | 1 + _static/shibuya.js | 41 + _static/speed-comparisons.png | Bin 0 -> 84342 bytes _static/sphinx_highlight.js | 154 ++ _static/stats-dark.png | Bin 0 -> 69926 bytes _static/stats-default.png | Bin 0 -> 82276 bytes _static/stats-light.png | Bin 0 -> 58505 bytes _static/tabs.css | 89 ++ _static/tabs.js | 145 ++ all_moccasin_toml_parameters.html | 411 +++++ api_reference/config_reference.html | 563 +++++++ api_reference/moccasin_account_reference.html | 322 ++++ api_reference/named_contract_reference.html | 347 +++++ api_reference/network_reference.html | 562 +++++++ api_reference/networks_reference.html | 353 +++++ class_reference.html | 282 ++++ cli_commands.html | 1340 +++++++++++++++++ cli_reference/compile.html | 312 ++++ cli_reference/config.html | 291 ++++ cli_reference/console.html | 325 ++++ cli_reference/deploy.html | 334 ++++ cli_reference/deployments.html | 342 +++++ cli_reference/explorer.html | 390 +++++ cli_reference/init.html | 325 ++++ cli_reference/inspect.html | 302 ++++ cli_reference/install.html | 311 ++++ cli_reference/purge.html | 300 ++++ cli_reference/run.html | 335 +++++ cli_reference/test.html | 427 ++++++ cli_reference/wallet.html | 446 ++++++ common_errors.html | 265 ++++ core_concepts/dependencies.html | 375 +++++ core_concepts/dependencies/purging.html | 304 ++++ .../dependencies/virtual_environments.html | 337 +++++ core_concepts/deployments.html | 337 +++++ core_concepts/moccasin_toml.html | 353 +++++ core_concepts/named_contracts.html | 387 +++++ .../named_contracts/manifest_contract.html | 386 +++++ core_concepts/networks.html | 309 ++++ core_concepts/networks/eravm.html | 290 ++++ core_concepts/networks/forked_networks.html | 312 ++++ core_concepts/networks/pyevm.html | 305 ++++ core_concepts/project.html | 307 ++++ core_concepts/script.html | 408 +++++ core_concepts/scripting/console.html | 275 ++++ core_concepts/scripting/deploy.html | 311 ++++ core_concepts/testing.html | 304 ++++ core_concepts/testing/coverage.html | 300 ++++ core_concepts/testing/fixtures.html | 314 ++++ core_concepts/testing/gas_profiling.html | 299 ++++ core_concepts/testing/pranking.html | 278 ++++ core_concepts/testing/staging_markers.html | 342 +++++ core_concepts/testing/titanoboa_testing.html | 276 ++++ core_concepts/wallet.html | 348 +++++ core_concepts/wallet/config_keys.html | 277 ++++ core_concepts/wallet/private_key.html | 274 ++++ explorer_network_defaults.html | 586 +++++++ genindex.html | 542 +++++++ how-tos/verify_contracts.html | 306 ++++ index.html | 398 +++++ installing_moccasin.html | 431 ++++++ objects.inv | Bin 0 -> 2365 bytes quickstart.html | 385 +++++ search.html | 125 ++ searchindex.js | 1 + toctree.html | 358 +++++ tutorials/zksync-getting-started.html | 319 ++++ 148 files changed, 25556 insertions(+) create mode 100644 .buildinfo create mode 100644 .nojekyll create mode 100644 _images/mark.svg create mode 100644 _sources/all_moccasin_toml_parameters.rst.txt create mode 100644 _sources/api_reference/config_reference.rst.txt create mode 100644 _sources/api_reference/moccasin_account_reference.rst.txt create mode 100644 _sources/api_reference/named_contract_reference.rst.txt create mode 100644 _sources/api_reference/network_reference.rst.txt create mode 100644 _sources/api_reference/networks_reference.rst.txt create mode 100644 _sources/class_reference.rst.txt create mode 100644 _sources/cli_commands.rst.txt create mode 100644 _sources/cli_reference/compile.rst.txt create mode 100644 _sources/cli_reference/config.rst.txt create mode 100644 _sources/cli_reference/console.rst.txt create mode 100644 _sources/cli_reference/deploy.rst.txt create mode 100644 _sources/cli_reference/deployments.rst.txt create mode 100644 _sources/cli_reference/explorer.rst.txt create mode 100644 _sources/cli_reference/init.rst.txt create mode 100644 _sources/cli_reference/inspect.rst.txt create mode 100644 _sources/cli_reference/install.rst.txt create mode 100644 _sources/cli_reference/purge.rst.txt create mode 100644 _sources/cli_reference/run.rst.txt create mode 100644 _sources/cli_reference/test.rst.txt create mode 100644 _sources/cli_reference/wallet.rst.txt create mode 100644 _sources/common_errors.rst.txt create mode 100644 _sources/core_concepts/dependencies.rst.txt create mode 100644 _sources/core_concepts/dependencies/purging.rst.txt create mode 100644 _sources/core_concepts/dependencies/virtual_environments.rst.txt create mode 100644 _sources/core_concepts/deployments.rst.txt create mode 100644 _sources/core_concepts/moccasin_toml.rst.txt create mode 100644 _sources/core_concepts/named_contracts.rst.txt create mode 100644 _sources/core_concepts/named_contracts/manifest_contract.rst.txt create mode 100644 _sources/core_concepts/networks.rst.txt create mode 100644 _sources/core_concepts/networks/eravm.rst.txt create mode 100644 _sources/core_concepts/networks/forked_networks.rst.txt create mode 100644 _sources/core_concepts/networks/pyevm.rst.txt create mode 100644 _sources/core_concepts/project.rst.txt create mode 100644 _sources/core_concepts/script.rst.txt create mode 100644 _sources/core_concepts/scripting/console.rst.txt create mode 100644 _sources/core_concepts/scripting/deploy.rst.txt create mode 100644 _sources/core_concepts/testing.rst.txt create mode 100644 _sources/core_concepts/testing/coverage.rst.txt create mode 100644 _sources/core_concepts/testing/fixtures.rst.txt create mode 100644 _sources/core_concepts/testing/gas_profiling.rst.txt create mode 100644 _sources/core_concepts/testing/pranking.rst.txt create mode 100644 _sources/core_concepts/testing/staging_markers.rst.txt create mode 100644 _sources/core_concepts/testing/titanoboa_testing.rst.txt create mode 100644 _sources/core_concepts/wallet.rst.txt create mode 100644 _sources/core_concepts/wallet/config_keys.rst.txt create mode 100644 _sources/core_concepts/wallet/private_key.rst.txt create mode 100644 _sources/explorer_network_defaults.rst.txt create mode 100644 _sources/how-tos/verify_contracts.rst.txt create mode 100644 _sources/index.rst.txt create mode 100644 _sources/installing_moccasin.rst.txt create mode 100644 _sources/quickstart.rst.txt create mode 100644 _sources/toctree.rst.txt create mode 100644 _sources/tutorials/zksync-getting-started.rst.txt create mode 100644 _static/basic.css create mode 100644 _static/check-solid.svg create mode 100644 _static/clipboard.min.js create mode 100644 _static/compile-stats.png create mode 100644 _static/copy-button.svg create mode 100644 _static/copybutton.css create mode 100644 _static/copybutton.js create mode 100644 _static/copybutton_funcs.js create mode 100644 _static/docs-logo.png create mode 100644 _static/doctools.js create mode 100644 _static/documentation_options.js create mode 100644 _static/favicon.svg create mode 100644 _static/file.png create mode 100644 _static/gh_banner.png create mode 100644 _static/how-to-kill.png create mode 100644 _static/language_data.js create mode 100644 _static/mark.svg create mode 100644 _static/minus.png create mode 100644 _static/moccasin_logo.png create mode 100644 _static/moccasin_logo.svg create mode 100644 _static/plus.png create mode 100644 _static/print.css create mode 100644 _static/pygments.css create mode 100644 _static/searchtools.js create mode 100644 _static/shibuya.css create mode 100644 _static/shibuya.js create mode 100644 _static/speed-comparisons.png create mode 100644 _static/sphinx_highlight.js create mode 100644 _static/stats-dark.png create mode 100644 _static/stats-default.png create mode 100644 _static/stats-light.png create mode 100644 _static/tabs.css create mode 100644 _static/tabs.js create mode 100644 all_moccasin_toml_parameters.html create mode 100644 api_reference/config_reference.html create mode 100644 api_reference/moccasin_account_reference.html create mode 100644 api_reference/named_contract_reference.html create mode 100644 api_reference/network_reference.html create mode 100644 api_reference/networks_reference.html create mode 100644 class_reference.html create mode 100644 cli_commands.html create mode 100644 cli_reference/compile.html create mode 100644 cli_reference/config.html create mode 100644 cli_reference/console.html create mode 100644 cli_reference/deploy.html create mode 100644 cli_reference/deployments.html create mode 100644 cli_reference/explorer.html create mode 100644 cli_reference/init.html create mode 100644 cli_reference/inspect.html create mode 100644 cli_reference/install.html create mode 100644 cli_reference/purge.html create mode 100644 cli_reference/run.html create mode 100644 cli_reference/test.html create mode 100644 cli_reference/wallet.html create mode 100644 common_errors.html create mode 100644 core_concepts/dependencies.html create mode 100644 core_concepts/dependencies/purging.html create mode 100644 core_concepts/dependencies/virtual_environments.html create mode 100644 core_concepts/deployments.html create mode 100644 core_concepts/moccasin_toml.html create mode 100644 core_concepts/named_contracts.html create mode 100644 core_concepts/named_contracts/manifest_contract.html create mode 100644 core_concepts/networks.html create mode 100644 core_concepts/networks/eravm.html create mode 100644 core_concepts/networks/forked_networks.html create mode 100644 core_concepts/networks/pyevm.html create mode 100644 core_concepts/project.html create mode 100644 core_concepts/script.html create mode 100644 core_concepts/scripting/console.html create mode 100644 core_concepts/scripting/deploy.html create mode 100644 core_concepts/testing.html create mode 100644 core_concepts/testing/coverage.html create mode 100644 core_concepts/testing/fixtures.html create mode 100644 core_concepts/testing/gas_profiling.html create mode 100644 core_concepts/testing/pranking.html create mode 100644 core_concepts/testing/staging_markers.html create mode 100644 core_concepts/testing/titanoboa_testing.html create mode 100644 core_concepts/wallet.html create mode 100644 core_concepts/wallet/config_keys.html create mode 100644 core_concepts/wallet/private_key.html create mode 100644 explorer_network_defaults.html create mode 100644 genindex.html create mode 100644 how-tos/verify_contracts.html create mode 100644 index.html create mode 100644 installing_moccasin.html create mode 100644 objects.inv create mode 100644 quickstart.html create mode 100644 search.html create mode 100644 searchindex.js create mode 100644 toctree.html create mode 100644 tutorials/zksync-getting-started.html diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 0000000..b7c464f --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 62afa94cab03edee1768d9694097e4a0 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/_images/mark.svg b/_images/mark.svg new file mode 100644 index 0000000..b2f60a6 --- /dev/null +++ b/_images/mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_sources/all_moccasin_toml_parameters.rst.txt b/_sources/all_moccasin_toml_parameters.rst.txt new file mode 100644 index 0000000..d60c77e --- /dev/null +++ b/_sources/all_moccasin_toml_parameters.rst.txt @@ -0,0 +1,111 @@ +All moccasin toml parameters +============================ + +TOML Formatting +--------------- + +In TOML you can think of each section as a giant JSON object. Each of these are essentially identical: + ++----------------------------------+----------------------------------+----------------------------------+ +| TOML (Expanded) | TOML (Compact) | JSON | ++==================================+==================================+==================================+ +| .. code-block:: toml | .. code-block:: bash | .. code-block:: json | +| | | | +| [project] | [project] | { | +| src = "contracts" | src = "contracts" | "project": { | +| | networks = { | "src": "contracts", | +| [project.networks.sepolia] | sepolia = { | "networks": { | +| url = "https://..." | url = "https://...", | "sepolia": { | +| chain_id = 11155111 | chain_id = 11155111 | "url": "https://...", | +| | }, | "chain_id": 11155111 | +| [project.networks.zksync] | zksync = { | }, | +| url = "https://..." | url = "https://...", | "zksync": { | +| chain_id = 324 | chain_id = 324 | "url": "https://...", | +| | } | "chain_id": 324 | +| | } | } | +| | | } | +| | | } | +| | | } | ++----------------------------------+----------------------------------+----------------------------------+ + + + +All possible options +-------------------- + +.. code-block:: toml + + # Changes the names and locations of specific directories in your project + [project] + src = "contracts" + out = "build" + script = "scripts" + lib = "dependencies" + # You can have pip-style dependencies and also github-style dependencies + # These are going to be dependencies for your vyper contracts + dependencies = ["snekmate==0.1.0", "pcaversaccio/snekmate@0.1.0"] + save_abi_path = "abis" # location to save ABIs from the explorer + cov_config = ".coveragerc" # coverage configuration file + dot_env = ".env" # environment variables file + default_network = "pyevm" # default network to use. `pyevm` is the local network. "eravm" is the local ZKSync network + db_path = ".deployments.db" # path to the deployments database + + [networks.pyevm] + # The basic EVM local network + # cannot set URL, chain_id, is_fork, is_zksync, prompt_live, explorer_uri, explorer_api_key + default_account_name = "anvil" + + [networks.eravm] + # The special ZKSync Era local network + # cannot set URL, chain_id, is_fork, is_zksync, prompt_live, explorer_uri, explorer_api_key + default_account_name = "anvil" + + [networks.contracts] + # Default named contract parameters + usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3"} + + # Add network settings to easily interact with networks + [networks.sepolia] + url = "https://ethereum-sepolia-rpc.publicnode.com" + chain_id = 11155111 + is_fork = false + is_zksync = false + # This is the name of the account that will be unlocked when running on this network + default_account_name = "anvil" + # If you don't provide a password or private key, moccasin will prompt you to unlock it + # If you do, it will unlock it automatically + # But be careful about storing passwords and private keys! NEVER store them in plain text + unsafe_password_file = "/home/user/.moccasin/password" # Replace with actual path + explorer_uri = "https://api.etherscan.io/api" # path for the supported explorer + explorer_api_key = "your_api_key" # api key for the supported explorer, overrides the main one + explorer_type = "blockscout" # If the explorer URL has "blockscout" or "etherscan" in the name, you don't need this + prompt_live = true # A flag that will prompt you before sending a transaction, it defaults to true for "non-testing" networks + save_to_db = true # A flag that will save the deployment to the database, it defaults to true for "non-testing" networks (not pyevm, eravm, or a fork network) + live_or_staging = true # A flag that will determine if the network is live or staging for the `@pytest.mark.staging` decorator, it defaults to true for non-local, non-forked networks + + [networks.sepolia.contracts] + # You can override the default named contract parameters + usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3", abi = "ERC20.vy", force_deploy = false, fixture = false, deployer_script = "script/deploy.py"} + + # You can also format a contract like this, for example, this one is "dai" + [networks.sepolia.contracts.dai] + address = "0x6b175474e89094c44da98b954eedeac495271d0f" + abi = "ERC20.vy" + force_deploy = false + + [networks.sepolia.extra_data] + my_data = "hi" + + # Put whatever else you want in here + [extra_data] + hi = "hello" + +Environment Variables +--------------------- + +Additionally, there are a few environment variables that ``moccasin`` will look for, but it's also ok if they are not set. It's important to note, that the `.env` file you set in the config will be ignored for these values. + +.. code-block:: bash + + MOCCASIN_DEFAULT_FOLDER = "~/.moccasin" # path to the moccasin folder + MOCCASIN_KEYSTORE_PATH = "~/.moccasin/keystore" # path to the keystore \ No newline at end of file diff --git a/_sources/api_reference/config_reference.rst.txt b/_sources/api_reference/config_reference.rst.txt new file mode 100644 index 0000000..acf891c --- /dev/null +++ b/_sources/api_reference/config_reference.rst.txt @@ -0,0 +1,7 @@ +``Config`` +########## + +.. autoclass:: moccasin.config.Config + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/_sources/api_reference/moccasin_account_reference.rst.txt b/_sources/api_reference/moccasin_account_reference.rst.txt new file mode 100644 index 0000000..8225134 --- /dev/null +++ b/_sources/api_reference/moccasin_account_reference.rst.txt @@ -0,0 +1,7 @@ +``MoccasinAccount`` +################### + +.. autoclass:: moccasin.moccasin_account.MoccasinAccount + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/_sources/api_reference/named_contract_reference.rst.txt b/_sources/api_reference/named_contract_reference.rst.txt new file mode 100644 index 0000000..aceb308 --- /dev/null +++ b/_sources/api_reference/named_contract_reference.rst.txt @@ -0,0 +1,7 @@ +``NamedContract`` +################# + +.. autoclass:: moccasin.named_contract.NamedContract + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/_sources/api_reference/network_reference.rst.txt b/_sources/api_reference/network_reference.rst.txt new file mode 100644 index 0000000..81ef2d9 --- /dev/null +++ b/_sources/api_reference/network_reference.rst.txt @@ -0,0 +1,7 @@ +``Network`` +########### + +.. autoclass:: moccasin.config.Network + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/_sources/api_reference/networks_reference.rst.txt b/_sources/api_reference/networks_reference.rst.txt new file mode 100644 index 0000000..f392763 --- /dev/null +++ b/_sources/api_reference/networks_reference.rst.txt @@ -0,0 +1,7 @@ +``_Networks`` +############# + +.. autoclass:: moccasin.config._Networks + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/_sources/class_reference.rst.txt b/_sources/class_reference.rst.txt new file mode 100644 index 0000000..475af7c --- /dev/null +++ b/_sources/class_reference.rst.txt @@ -0,0 +1,13 @@ +Classes Reference +################# + +mox +=== + +You can find API information for all classes in the the ``moccasin`` tool. + +.. toctree:: + :maxdepth: 4 + :glob: + + api_reference/* \ No newline at end of file diff --git a/_sources/cli_commands.rst.txt b/_sources/cli_commands.rst.txt new file mode 100644 index 0000000..beda8fd --- /dev/null +++ b/_sources/cli_commands.rst.txt @@ -0,0 +1,16 @@ +CLI Command Reference +##################### + +mox +=== + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_main_parser + :prog: mox + +.. toctree:: + :maxdepth: 3 + :glob: + + cli_reference/* \ No newline at end of file diff --git a/_sources/cli_reference/compile.rst.txt b/_sources/cli_reference/compile.rst.txt new file mode 100644 index 0000000..2dbe40b --- /dev/null +++ b/_sources/cli_reference/compile.rst.txt @@ -0,0 +1,7 @@ +compile +####### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_compile + :prog: mox compile \ No newline at end of file diff --git a/_sources/cli_reference/config.rst.txt b/_sources/cli_reference/config.rst.txt new file mode 100644 index 0000000..78a5efa --- /dev/null +++ b/_sources/cli_reference/config.rst.txt @@ -0,0 +1,7 @@ +config +###### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_config + :prog: mox config \ No newline at end of file diff --git a/_sources/cli_reference/console.rst.txt b/_sources/cli_reference/console.rst.txt new file mode 100644 index 0000000..35dd170 --- /dev/null +++ b/_sources/cli_reference/console.rst.txt @@ -0,0 +1,7 @@ +console +####### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_console + :prog: mox console \ No newline at end of file diff --git a/_sources/cli_reference/deploy.rst.txt b/_sources/cli_reference/deploy.rst.txt new file mode 100644 index 0000000..f9773ed --- /dev/null +++ b/_sources/cli_reference/deploy.rst.txt @@ -0,0 +1,7 @@ +deploy +###### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_deploy + :prog: mox deploy \ No newline at end of file diff --git a/_sources/cli_reference/deployments.rst.txt b/_sources/cli_reference/deployments.rst.txt new file mode 100644 index 0000000..595ba4a --- /dev/null +++ b/_sources/cli_reference/deployments.rst.txt @@ -0,0 +1,7 @@ +deployments +########### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_deployments + :prog: mox deployments \ No newline at end of file diff --git a/_sources/cli_reference/explorer.rst.txt b/_sources/cli_reference/explorer.rst.txt new file mode 100644 index 0000000..9b79eaf --- /dev/null +++ b/_sources/cli_reference/explorer.rst.txt @@ -0,0 +1,7 @@ +explorer +######## + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_explorer + :prog: mox explorer \ No newline at end of file diff --git a/_sources/cli_reference/init.rst.txt b/_sources/cli_reference/init.rst.txt new file mode 100644 index 0000000..39ab50b --- /dev/null +++ b/_sources/cli_reference/init.rst.txt @@ -0,0 +1,7 @@ +init +#### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_init + :prog: mox init \ No newline at end of file diff --git a/_sources/cli_reference/inspect.rst.txt b/_sources/cli_reference/inspect.rst.txt new file mode 100644 index 0000000..3932ab7 --- /dev/null +++ b/_sources/cli_reference/inspect.rst.txt @@ -0,0 +1,7 @@ +inspect +####### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_inspect + :prog: mox inspect \ No newline at end of file diff --git a/_sources/cli_reference/install.rst.txt b/_sources/cli_reference/install.rst.txt new file mode 100644 index 0000000..c034d3e --- /dev/null +++ b/_sources/cli_reference/install.rst.txt @@ -0,0 +1,7 @@ +install +####### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_install + :prog: mox install \ No newline at end of file diff --git a/_sources/cli_reference/purge.rst.txt b/_sources/cli_reference/purge.rst.txt new file mode 100644 index 0000000..1d04fdc --- /dev/null +++ b/_sources/cli_reference/purge.rst.txt @@ -0,0 +1,7 @@ +purge +##### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_purge + :prog: mox purge \ No newline at end of file diff --git a/_sources/cli_reference/run.rst.txt b/_sources/cli_reference/run.rst.txt new file mode 100644 index 0000000..8e91bd1 --- /dev/null +++ b/_sources/cli_reference/run.rst.txt @@ -0,0 +1,7 @@ +run +### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_run + :prog: mox run \ No newline at end of file diff --git a/_sources/cli_reference/test.rst.txt b/_sources/cli_reference/test.rst.txt new file mode 100644 index 0000000..d5372ab --- /dev/null +++ b/_sources/cli_reference/test.rst.txt @@ -0,0 +1,7 @@ +test +#### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_test + :prog: mox test \ No newline at end of file diff --git a/_sources/cli_reference/wallet.rst.txt b/_sources/cli_reference/wallet.rst.txt new file mode 100644 index 0000000..063fdf0 --- /dev/null +++ b/_sources/cli_reference/wallet.rst.txt @@ -0,0 +1,7 @@ +wallet +###### + +.. argparse:: + :module: moccasin_wrapper_for_docs + :func: get_wallet + :prog: mox wallet \ No newline at end of file diff --git a/_sources/common_errors.rst.txt b/_sources/common_errors.rst.txt new file mode 100644 index 0000000..2d4d167 --- /dev/null +++ b/_sources/common_errors.rst.txt @@ -0,0 +1,7 @@ +Common Errors +============= + +ValueError: .eoa not defined! +---------------------------------------------------------------------------- + +This is the most common error you'll run into, and it means you'll need to add an account to your ``moccasin.toml``. You can do this by following the :doc:`wallet ` guide. \ No newline at end of file diff --git a/_sources/core_concepts/dependencies.rst.txt b/_sources/core_concepts/dependencies.rst.txt new file mode 100644 index 0000000..654dc73 --- /dev/null +++ b/_sources/core_concepts/dependencies.rst.txt @@ -0,0 +1,137 @@ +Dependencies +############ + +For working with smart contracts, ``moccasin`` allows for working with either: + +- :ref:`Installing from GitHub repositories ` + +- :ref:`Installing Python PyPI packages ` (these are your "normal" pip packages) + +Importantly, the packages/dependencies that you install are *smart contract dependencies only*. Meaning that they are dependencies for your vyper contracts, not for your python scripts. + +To see working with python dependencies, go to :doc:`/core_concepts/dependencies/virtual_environments`. + + +.. _installing_github_dependencies: + +Installing GitHub Dependencies +============================== + +To install a package from GitHub, you can run the following: + +.. code-block:: bash + + mox install ORG/REPO[@VERSION] + +For example: + +.. code-block:: bash + + # Without a version + mox install pcaversaccio/snekmate + # With a version + mox install pcaversaccio/snekmate@0.1.0 + +This will create an entry in your ``moccasin.toml`` file that looks like this: + +.. code-block:: toml + + [project] + dependencies = [ + "pcaversaccio/snekmate@0.1.0", + ] + +Which follows the same syntax that `pip` and `uv` to do installs from GitHub repositories. This will also download the GitHub repository into your `lib` folder. + +You can then use these packages in your vyper contracts, for example in an miniaml ERC20 vyper contract: + +.. code-block:: python + + from pcaversaccio.snekmate.src.snekmate.auth import ownable as ow + initializes: ow + + from pcaversaccio.snekmate.src.snekmate.tokens import erc20 + initializes: erc20[ownable := ow] + exports: erc20.__interface__ + + @deploy + @payable + def __init__(): + erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02") + ow.__init__() + +``moccasin`` is smart enough to know that the `lib/github` and `lib/pypi` folders are part of the search path, but you can also explicitly add your dependencies. + +.. code-block:: python + + # This is the "true" search path + from lib.github.pcaversaccio.snekmate.src.snekmate.auth import ownable as ow + initializes: ow + + from lib.github.pcaversaccio.snekmate.src.snekmate.tokens import erc20 + initializes: erc20[ownable := ow] + exports: erc20.__interface__ + + @deploy + @payable + def __init__(): + erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02") + ow.__init__() + +.. _installing_pip_dependencies: + + +Installing uv/pip/PyPI Dependencies +=================================== + +Moccasin let's you directly install and work with PyPI packages as you would any other python package. PyPi dependencies in moccasin are by default powered by the `uv `_ tool under the hood. It comes built-in with ``moccasin``. + +To install a package from PyPI, you can run the following: + +.. code-block:: bash + + mox install PACKAGE + +For example: + +.. code-block:: bash + + mox install snekmate + +.. note:: + + Snekmate is both a `pypi `_ and a GitHub package. + +This will create an entry in your ``moccasin.toml`` file that looks like this: + +.. code-block:: toml + + [project] + dependencies = [ + "snekmate==0.1.0", + ] + +You can then use these packages in your vyper contracts, for example in an miniaml ERC20 vyper contract: + +.. code-block:: python + + # Vyper will directly inject the package into your contract + from snekmate.auth import ownable as ow + initializes: ow + + from snekmate.tokens import erc20 + initializes: erc20[ownable := ow] + exports: erc20.__interface__ + + @deploy + @payable + def __init__(): + erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02") + ow.__init__() + +.. toctree:: + :maxdepth: 3 + + Working with python dependencies + Removing dependencies (purge) + \ No newline at end of file diff --git a/_sources/core_concepts/dependencies/purging.rst.txt b/_sources/core_concepts/dependencies/purging.rst.txt new file mode 100644 index 0000000..9d0807b --- /dev/null +++ b/_sources/core_concepts/dependencies/purging.rst.txt @@ -0,0 +1,38 @@ +Removing Dependencies (Purge) +############################# + +To remove a dependency from both: + +- Your project (your ``lib`` folder) +- Your ``moccasin.toml`` file + + +You can use the :doc:`purge ` command. + +Removing a pypi/pip dependency +------------------------------ + +To remove a pypi/pip dependency, you can run the following: + +.. code-block:: bash + + mox purge PACKAGE_NAME + +And it will be removed from your: + +- ``lib`` folder +- ``moccasin.toml`` file + +Removing a GitHub dependency +---------------------------- + +To remove a GitHub dependency, you can run the following: + +.. code-block:: bash + + mox purge ORG/REPO + +And it will be removed from your: + +- ``lib`` folder +- ``moccasin.toml`` file diff --git a/_sources/core_concepts/dependencies/virtual_environments.rst.txt b/_sources/core_concepts/dependencies/virtual_environments.rst.txt new file mode 100644 index 0000000..1c86f95 --- /dev/null +++ b/_sources/core_concepts/dependencies/virtual_environments.rst.txt @@ -0,0 +1,83 @@ +.. _virtual_environments: + +Python packages in your scripts +############################### + +When you want to add python packages to use in your scripts, it depends on how you installed ``moccasin``. + +In an isolated environment (``uv tool install`` or ``pipx install``) +-------------------------------------------------------------------- + +If you installed ``moccasin`` with the ``uv tool install`` or ``pipx install``, you can re-install your ``moccasin`` installation using the ``--with`` flag to "inject" the python packages you want to use. + + +.. tabs:: + + .. code-tab:: bash uv + + # This will reinstall moccasin with pandas + uv tool install moccasin --with pandas + + .. code-tab:: bash pipx + + # With pipx you don't need to reinstall, you'll just "inject" the python packages you want to use. + pipx inject moccasin pandas + + +In a virtual environment (``uv pip install``, ``uv add``, or ``pip install``) +----------------------------------------------------------------------------- + +Let's say you have setup a virtual environment: + +.. tabs:: + + .. code-tab:: bash uv + + uv init + uv venv + source .venv/bin/activate + + .. code-tab:: bash pip / python + + python -m venv .venv + source .venv/bin/activate + + .. code-tab:: bash poetry + + poetry init + poetry shell + +.. note:: + + Remember, to deactivate run: + + .. code-block:: bash + + deactivate + + +You can install python packages as you'd expect: + +.. tabs:: + + .. code-tab:: bash uv + + uv add pandas + + .. code-tab:: bash uv-pip + + uv pip install pandas + + .. code-tab:: bash pip + + pip install pandas + + .. code-tab:: bash poetry + + poetry add pandas + +.. note:: + + If you installed ``moccasin`` with ``uv add moccasin`` you'll only be able to use these packages with ``uv run mox``. If you want to use the ``mox`` command in your virtual environment, you'll need to install ``moccasin`` with ``uv pip install moccasin``. + +We highly recommend that you setup a virtual environment or injecting packages into your mox isolated environment for working with your python scripts. And our recommended method is with the ``uv`` tool. \ No newline at end of file diff --git a/_sources/core_concepts/deployments.rst.txt b/_sources/core_concepts/deployments.rst.txt new file mode 100644 index 0000000..b70a542 --- /dev/null +++ b/_sources/core_concepts/deployments.rst.txt @@ -0,0 +1,90 @@ +Deployments +########### + +In smart contract development, users often want to interact with contracts they've recently deployed, and keep track of them, so ``moccasin`` comes with a built-in `sqlite3 `_ database. + +Any time you deploy a smart contract, so long as you have your ``save_to_db`` flag set to ``true`` in your `config `, ``moccasin`` will automatically save your deployments to the database. Here is an example ``moccasin.toml`` file: + +.. code-block:: toml + + [networks.pyevm] + save_to_db = false # Local and forked networks default to false + + [networks.anvil] + save_to_db = true # Any other network default to true + db_path = ".deployments.db" + +Getting a deployment by contract name +===================================== + +You can then, get your latest deployment with any of the following options: + +.. code-block:: python + + from moccasin.config import get_config + from boa.contracts.abi.abi_contract import ABIContract + # from boa.deployments import Deployment + + + def moccasin_main(): + config = get_config() + active_network = config.get_active_network() + + # Get the latest counter of the Counter contract + counter_contract: ABIContract = active_network.get_latest_contract_unchecked("Counter") + +This will get you a ``counter_contract`` object that you can interact with. It will look in the database and return the most recently deployed contract on the network that your script is active on. It'll assign the ``ABI`` of your contract when you deployed it to the bytecode at that address. + +There are a number of functions we can call to get either a ``ABIContract`` or ``Deployment`` object. + +- ``get_deployments_unchecked``: This will return all deployments for a given contract name, without checking :ref:`checking integrity `. + +- ``get_deployments_checked``: This will return all deployments for a given contract name, checking :ref:`checking integrity `. + +- ``get_latest_deployment_checked``: This will return the latest deployment for a given contract name, checking :ref:`checking integrity `. + +- ``get_latest_deployment_unchecked``: This will return the latest deployment for a given contract name, without checking :ref:`checking integrity `. + +- ``get_latest_contract_checked``: This will return the latest contract for a given contract name, checking :ref:`checking integrity `. It will convert the ``Deployment`` object to an ``ABIContract``. + +- ``get_latest_contract_unchecked``: This will return the latest contract for a given contract name, without checking :ref:`checking integrity `. It will convert the ``Deployment`` object to an ``ABIContract``. + +- ``get_or_deploy_contract``/ ``manifest_contract``: This "magical" function will either check the database for a contract, deploy it, check your :doc:`named contracts `, and a few other places, and if it doesn't find a contract, it will deploy the contract for you. :doc:`You can read more about it here. ` + +.. _checking_integrity: + +Checked vs Unchecked +==================== + +When developing, you'll often make changes to your smart contracts, and you may want to only interact with a contract that matches your current working contract. For example, I could have this code in a file called ``Counter.vy``: + +.. code-block:: python + + # SPDX-License-Identifier: MIT + # pragma version 0.4.0 + number: public(uint256) + @external + def set_number(new_number: uint256): + self.number = new_number + + + @external + def increment(): + self.number += 1 + +And deploy it as ``contract A``, then, change it: + +.. code-block:: python + + # SPDX-License-Identifier: MIT + # pragma version 0.4.0 + number: public(uint256) + @external + def set_number(new_number: uint256): + self.number = new_number + +And deploy it as ``contract B``. + +Now, when I call ``get_deployments_checked`` on ``Counter``, it will only return 1 contract, ``contract B`` since that matches the contract that is in my current ``Counter.vy`` file. + +But, if I call ``get_deployments_unchecked`` on ``Counter``, it will return both ``contract A`` and ``contract B``! Since that will only return deployments based on the ``contract_name`` (filename). The way this works, is that under the hood, ``moccasin`` does an integrity check by calling ``has_matching_integrity`` on the ``Network`` class, which compares a hash of each of the contract bytecodes to each other. \ No newline at end of file diff --git a/_sources/core_concepts/moccasin_toml.rst.txt b/_sources/core_concepts/moccasin_toml.rst.txt new file mode 100644 index 0000000..b6322fb --- /dev/null +++ b/_sources/core_concepts/moccasin_toml.rst.txt @@ -0,0 +1,102 @@ +moccasin.toml +############## + +.. note:: + + For an exhaustive list of options for your ``moccasin.toml`` file, see the :doc:`all moccasin toml parameters ` documentation. + +The ``moccasin.toml`` file created is our configuration file. In this file we can have: + +- project and layout settings + +- network settings + +- dependencies settings + +- extra data + +A ``moccasin.toml`` file can look like this: + +.. code-block:: toml + + [project] + dependencies = ["snekmate==0.1.0"] + src = "contracts" + explorer_api_key = "${ETHERSCAN_API_KEY}" + dot_env = ".env" + + [networks.sepolia] + url = "https://ethereum-sepolia-rpc.publicnode.com" + chain_id = 11155111 + + [extra_data] + my_key = "other_data" + + +You can learn more about each of the sections of the ``moccasin.toml`` file in their respective documentation. + +- :doc:`Project ` +- :doc:`Networks ` +- :doc:`Dependencies ` + +You can also see a full example of a ``moccasin.toml`` in the :doc:`all moccasin toml parameters ` documentation. + +Extra Data +========== + +Extra data is a dictionary of data where you can put whatever you'd like. You can access it from your scripts with: + +.. code-block:: python + + from moccasin import config + print(config.get_config().extra_data["my_key"]) + +``pyproject.toml`` +================== + +If you like, you don't even need to use a ``moccasin.toml``, and instead you can just use a normal ``pyproject.toml`` file. + +.. important:: + + If you have a ``moccasin.toml`` file, that file will have precedence over the ``pyproject.toml`` file. So if you have a parameter defined in both files, the value in the ``moccasin.toml`` file will be used. + + +An example ``pyproject.toml`` with a ``moccasin`` section would look like this: + +.. code-block:: toml + + # unrelated to your moccasin project, aka, "normal" python project settings + [project] + name = "project-no-config" + version = "0.1.0" + description = "Add your description here" + readme = "README.md" + requires-python = ">=3.11, <=3.13" + dependencies = [] + + # moccasin project settings + [tool.moccasin.project] + src = "contracts" + dot_env = ".hello" + + [tool.moccasin.networks.sepolia] + url = "https://ethereum-sepolia-rpc.publicnode.com" + +You have all the same options as you would in a ``moccasin.toml`` file, you'll just need to prepend each with ``[tool.moccasin]``. + + +Order Of Operations +=================== + +Whenever you run a script, you'll want to remember this order: + +1. Script +2. Command Line +3. ``moccasin.toml`` +4. ``pyproject.toml`` +5. Defaults + +Whatever you place in your python script, will be the value used, even if your command line has a different value. Similarly, any flag passed to the command line will override any values in your ``moccasin.toml``, which will override any values in ``pyproject.toml``, which will override default values moccasin sets. + +This allows you to set your config file up, but if you want to make a tweak you don't have to touch your source code, you can just adjust it on the fly! + diff --git a/_sources/core_concepts/named_contracts.rst.txt b/_sources/core_concepts/named_contracts.rst.txt new file mode 100644 index 0000000..232d6b4 --- /dev/null +++ b/_sources/core_concepts/named_contracts.rst.txt @@ -0,0 +1,141 @@ +Named Contracts +############### + +One of the major differentiators between moccasin and other smart contract development tools is more flexible and powerful scripting. One of the such cabailities is built in :doc:`fixtures ` and :doc:`named contracts `. + +**Named contracts allow you to define deployment scripts, addresses by chain, fixtures settings for testing, and more.** + +Named Contract Example - Minimal Example +======================================== + +Let's look at a minimal ``moccasin.toml`` with a ETH mainnet network fork with a named contract: + +.. code-block:: toml + + [project] + src = "contracts" + + [networks.mainnet-fork] + url = "https://ethereum-rpc.publicnode.com" + chain_id = 1 + fork = true + + # Look here! We have a named contract named "usdc" + [networks.mainnet-fork.contracts] + usdc = { address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"} + +The `NamedContract` in this case, is `usdc`. And it's this named contract that we can access our scripts! + +.. code-block:: python + + from moccasin.config import get_config + + def print_contract_address(): + active_network = get_config().get_active_network() + named_contract = active_network.get_named_contract("usdc") + print(named_contract.address) + + def moccasin_main(): + print_contract_address() + +We could run this script, and it would, print out the address from our config. + +.. code-block:: bash + + mox run print_contract_address --network mainnet-fork + + 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 + + +.. _manifest_intro: + +Named Contract Example - Interacting with the contract +====================================================== + +Now, just getting the address is pretty boring, typically you want to interact with the contract. To do so, we have a number of parameters you can set in the config to get the contract ABI (Application Binary Interface). + +.. note:: + + You can learn more about what an ABI is from `Cyfrin Updraft `_ or the `Cyfrin Blog `_. + +There are a number of flags we can set for our ``NamedContract``: + +.. tabs:: + + .. code-tab:: toml true-toml + + [networks.mainnet-fork.contracts.usdc] + address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" + abi = "ERC20.vy" + abi_from_explorer = true + fixture = false + deployment_script = "script/deploy_erc20.py" + force_deploy = false + + .. code-tab:: bash ugly-toml + + # Did you know that this format will work the same? + # It's technically the "uglier" version toml + [networks.mainnet-fork.contracts] + usdc = { + address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" + abi = "ERC20.vy" + abi_from_explorer = true + fixture = false + deployment_script = "script/deploy_erc20.py" + force_deploy = false + } + +Let's break these down: + +- ``address``: The address of the contract on the network. +- ``abi```: The ABI source of the contract. This is can be any of the following: + - ``.json`` file path to an ABI file + - ``.vy`` file path to a Vyper contract + - *Coming soon* ``.vyi`` file path to a Vyper interface + - A "raw" ABI string +- ``abi_from_explorer``: If you want to get the ABI from an explorer. This is useful if you don't have the ABI and you want to get it from a public source. You'll need to set a ``explorer_api_key`` in your ``moccasin.toml``, or an ``EXPLORER_API_KEY`` environment variable. +- ``fixture```: If you want to use this contract as a :doc:`fixture `. +- ``deployment_script``: The path to the :doc:`deployment script ` for this named contract, this will be a shorthand for deploying in the future. +- ``force_deploy```: If you want to force deploy the contract when :ref:`manifesting ` the contract. + +As we know, to interact with a contract, one of the most important things is the ABI. For us to interact with any named contract, we give it an ABI, and we can start interacting with that named contract using the ``manifest_contract`` function. + +.. code-block:: python + + from moccasin.config import get_config + + def print_contract_address(): + active_network = get_config().get_active_network() + usdc: VyperContract = active_network.manifest_contract("usdc") + decimals = usdc.decimals() + print(decimals) + + def moccasin_main(): + print_contract_address() + +And running this on ``mainnet-fork`` will get the resulting output: + +.. code-block + + # Run this + mox run print_contract_address --network mainnet-fork + + # Output + 6 # USDC has 6 decimals because it is weird + +The key here, was the ``mainifest_contract``, which does a lot of things under the hood, including: + +- Deploys a contract if one doesn't exist +- Allows us to get fixtures for testing +- Returns the named contract at it's address if it's on a chain we recognize +- Sets up local testing environments for us to test our contracts + +And more! Let's read more about the power of ``NamedContract``\s and how they can help you in your development process. + + +.. toctree:: + :maxdepth: 2 + + Manifest Contract + \ No newline at end of file diff --git a/_sources/core_concepts/named_contracts/manifest_contract.rst.txt b/_sources/core_concepts/named_contracts/manifest_contract.rst.txt new file mode 100644 index 0000000..584db69 --- /dev/null +++ b/_sources/core_concepts/named_contracts/manifest_contract.rst.txt @@ -0,0 +1,128 @@ +.. _manifesting: + +Manifest Contract (``get_or_deploy_contract``) +============================================== + +.. note:: + + Be sure to at least read :ref:`manifest introduction ` before continuing here. + +An issue that developers run into when creating smart contracts, is knowing how to make their deployment and scripting pipelines portable and flexible. + +- What happens if you change chains that you want to deploy to? +- How can you test to make sure your deploy scripts work exactly the way your tests run? +- If I want to simulate a test with a `forked test `, will my scripts still work? + +This is where the ``manifest_contract`` aka ``get_or_deploy_contract`` function comes in. Let's say you have a smart contract that has an address as a constructor parameter, because the address is different on different chains. This additionally is very helpful in testing, and ``NamedContract``\s have built-in ``pytest`` :doc:`fixtures `. + +Interacting with a contract on multiple networks with one script +---------------------------------------------------------------- + +Let's take the following contract: + +.. code-block:: python + + # pragma version 0.4.0 + # SPDX-License-Identifier: MIT + from interfaces import ERC20 + + usdc: public(ERC20) + + @deploy + def __init__(usdc: address): + self.usdc = ERC20(usdc) + + @external + def get_usdc_decimals() -> uint256: + return self.usdc.decimals() + +We want to be able to test this contract on: + +- A locally running network +- A forked network +- A testnet +- A mainnet +- Potentially a second mainnet + +In order for us to do this traditionally, we'd have to write a separate script *for every single one of these cases*. For example: + +.. code-block:: python + + if network.name == "locally_running_chain": + # do something... + elif network.name == "forked_chain": + # do something... + elif network.name == "testnet": + # do something... + elif network.name == "mainnet": + # do something... + elif network.name == "second_mainnet": + # do something... + +And this is awful! So instead, what we can do, is setup **ALL** of the configuration in our ``moccasin.toml`` file and use the magic ``manifest_contract`` function to automatically deploy the contract on the correct network, with the correct parameters. Let's look at the ``moccasin.toml`` file: + +.. code-block:: toml + + # At the top, we can set some default parameters for the `usdc` named contract + # Every named contract will use the ERC20.vy contract in the project as it's ABI + # If the contract doesn't exist, it'll deploy with the `deploy_feed.py` script (for example, on a locally running network) + [networks.contracts] + usdc = { abi = "ERC20", deployer_script = "mock_deployer/deploy_feed.py"} + + # We can then set the parameters for each network + [networks.mainnet] + url = "mainnet_url" # Enter your mainnet url here + + [networks.mainnet.contracts] + usdc = { address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" } + + [networks.sepolia] + url = "sepolia_url" # Enter your mainnet url here + + [networks.sepolia.contracts] + usdc = { address = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238" } + + [networks.arbitrum] + url = "arbitrum" # Enter your mainnet url here + + [networks.arbitrum.contracts] + usdc = { address = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" } + +And with this, we only need ONE script that works for all of these! + +.. code-block:: python + + from moccasin.config import get_config + + def get_decimals(): + active_network = get_config().get_active_network() + usdc: VyperContract = active_network.manifest_contract("usdc") + decimals = usdc.decimals() + print(decimals) + + + def moccasin_main(): + get_decimals() + +Then, we just need to adjust the `--network` flag and everything else will work automatically. + +.. code-block:: bash + + # Mainnet + mox run get_decimals --network mainnet + # Sepolia + mox run get_decimals --network sepolia + # Arbitrum + mox run get_decimals --network arbitrum + + # These next two are special + + # Forked + mox run get_decimals --network mainnet --fork + # Local (pyevm) + mox run get_decimals + +The first 3 commands will do as you expect, directly connecting to the URL you set in your ``moccasin.toml`` file. The last two are special: + +- The ``--fork`` flag will setup your script to run locally, using your ``mainnet`` url. +- If you don't specify a network, you'll use the special locally running :doc:`pyevm ` network. \ No newline at end of file diff --git a/_sources/core_concepts/networks.rst.txt b/_sources/core_concepts/networks.rst.txt new file mode 100644 index 0000000..3bcf427 --- /dev/null +++ b/_sources/core_concepts/networks.rst.txt @@ -0,0 +1,52 @@ +Networks +======== + +Networks in ``moccasin`` are identified in your ``moccasin.toml``. The complete list of options you can set for your network can be identified in the example here: + +.. code-block:: toml + + [networks.sepolia] + url = "https://ethereum-sepolia-rpc.publicnode.com" + chain_id = 11155111 + is_fork = false + is_zksync = false + default_account_name = "anvil" + unsafe_password_file = "~/.moccasin/password" + extra_data = { "some_data" = "{$SOME_ENVIRONMENT_VARIABLE}" } + save_to_db = true + db_path = ".deployments.db" + +Let's walk through some of the options here. + +.. note:: + + You can see a full list of options in the :doc:`all moccasin toml parameters page`. + +- ``url``: The URL of the network you are connecting to. +- ``chain_id``: The chain ID of the network you are connecting to. +- ``is_fork``: If you are forking a network, set this to ``true``. +- ``is_zksync``: If you are connecting to a zkSync network, set this to ``true``. +- ``default_account_name``: The default account name to use when deploying contracts. This will be the name of your account you created with your :doc:`wallet ` command. +- ``unsafe_password_file``: The location of the password file for your account. This is a file that contains the password for your account. BE SURE TO NEVER PUSH THIS PASSWORD TO GITHUB IF YOU USE THIS. +- ``extra-data``: This is a dictionary of extra data you can use in your contracts. +- ``save_to_db``: If you want to save your :doc:`deployments ` to a database. +- ``db_path``: The database path of your :doc:`deployments `. + +You'll notice there is no ``private-key``. We highly discourage having private keys in plain text. + +When working with a network from the command line, for example to :doc:`run a script + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

All moccasin toml parameters

+
+

TOML Formatting

+

In TOML you can think of each section as a giant JSON object. Each of these are essentially identical:

+
+ + + + + + + + + + + + + +

TOML (Expanded)

TOML (Compact)

JSON

[project]
+src = "contracts"
+
+[project.networks.sepolia]
+url = "https://..."
+chain_id = 11155111
+
+[project.networks.zksync]
+url = "https://..."
+chain_id = 324
+
+
+
[project]
+src = "contracts"
+networks = {
+  sepolia = {
+    url = "https://...",
+    chain_id = 11155111
+  },
+  zksync = {
+    url = "https://...",
+    chain_id = 324
+  }
+}
+
+
+
{
+  "project": {
+    "src": "contracts",
+    "networks": {
+      "sepolia": {
+        "url": "https://...",
+        "chain_id": 11155111
+      },
+      "zksync": {
+        "url": "https://...",
+        "chain_id": 324
+      }
+    }
+  }
+}
+
+
+
+
+
+
+

All possible options

+
# Changes the names and locations of specific directories in your project
+[project]
+src = "contracts"
+out = "build"
+script = "scripts"
+lib = "dependencies"
+# You can have pip-style dependencies and also github-style dependencies
+# These are going to be dependencies for your vyper contracts
+dependencies = ["snekmate==0.1.0", "pcaversaccio/snekmate@0.1.0"]
+save_abi_path = "abis" # location to save ABIs from the explorer
+cov_config = ".coveragerc" # coverage configuration file
+dot_env = ".env"  # environment variables file
+default_network = "pyevm" # default network to use. `pyevm` is the local network. "eravm" is the local ZKSync network
+db_path = ".deployments.db" # path to the deployments database
+
+[networks.pyevm]
+# The basic EVM local network
+# cannot set URL, chain_id, is_fork, is_zksync, prompt_live, explorer_uri, explorer_api_key
+default_account_name = "anvil"
+
+[networks.eravm]
+# The special ZKSync Era local network
+# cannot set URL, chain_id, is_fork, is_zksync, prompt_live, explorer_uri, explorer_api_key
+default_account_name = "anvil"
+
+[networks.contracts]
+# Default named contract parameters
+usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3"}
+
+# Add network settings to easily interact with networks
+[networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+chain_id = 11155111
+is_fork = false
+is_zksync = false
+# This is the name of the account that will be unlocked when running on this network
+default_account_name = "anvil"
+# If you don't provide a password or private key, moccasin will prompt you to unlock it
+# If you do, it will unlock it automatically
+# But be careful about storing passwords and private keys! NEVER store them in plain text
+unsafe_password_file = "/home/user/.moccasin/password"  # Replace with actual path
+explorer_uri = "https://api.etherscan.io/api" # path for the supported explorer
+explorer_api_key = "your_api_key" # api key for the supported explorer, overrides the main one
+explorer_type = "blockscout" # If the explorer URL has "blockscout" or "etherscan" in the name, you don't need this
+prompt_live = true # A flag that will prompt you before sending a transaction, it defaults to true for "non-testing" networks
+save_to_db = true # A flag that will save the deployment to the database, it defaults to true for "non-testing" networks (not pyevm, eravm, or a fork network)
+live_or_staging = true # A flag that will determine if the network is live or staging for the `@pytest.mark.staging` decorator, it defaults to true for non-local, non-forked networks
+
+[networks.sepolia.contracts]
+# You can override the default named contract parameters
+usdc = {"address" = "0x5fbdb2315678afecb367f032d93f642f64180aa3", abi = "ERC20.vy", force_deploy = false, fixture = false, deployer_script = "script/deploy.py"}
+
+# You can also format a contract like this, for example, this one is "dai"
+[networks.sepolia.contracts.dai]
+address = "0x6b175474e89094c44da98b954eedeac495271d0f"
+abi = "ERC20.vy"
+force_deploy = false
+
+[networks.sepolia.extra_data]
+my_data = "hi"
+
+# Put whatever else you want in here
+[extra_data]
+hi = "hello"
+
+
+
+
+

Environment Variables

+

Additionally, there are a few environment variables that moccasin will look for, but it’s also ok if they are not set. It’s important to note, that the .env file you set in the config will be ignored for these values.

+
MOCCASIN_DEFAULT_FOLDER = "~/.moccasin" # path to the moccasin folder
+MOCCASIN_KEYSTORE_PATH = "~/.moccasin/keystore" # path to the keystore
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/api_reference/config_reference.html b/api_reference/config_reference.html new file mode 100644 index 0000000..fd41021 --- /dev/null +++ b/api_reference/config_reference.html @@ -0,0 +1,563 @@ + + + + + Config - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Config

+
+
+class moccasin.config.Config(root_path: Path | None)
+

Bases: object

+

A wrapper around the moccasin.toml file, it is also the main entry point for doing +almost anything with moccasin.

+

This class reads the moccasin.toml file and sets up project configuration.

+
+
Attributes:

_project_root (Path): The root directory of the project. +_toml_data (dict): The raw data from moccasin.toml. +dependencies (list[str]): Project dependencies from moccasin.toml. +project (dict[str, str]): Project data from moccasin.toml. +extra_data (dict[str, Any]): Any additional data from moccasin.toml. +networks (_Networks): Network configurations.

+
+
Args:

root_path (Path, optional): The root directory of the project. Defaults to None.

+
+
+
+
+activate_boa()
+
+ +
+
+activate_db()
+
+ +
+
+property build_folder: str
+
+ +
+
+property config_path: Path
+
+ +
+
+property contracts_folder: str
+
+ +
+
+property cov_config: str | None
+
+ +
+
+property default_network: str
+
+ +
+
+property default_network_name: str
+
+ +
+
+dependencies: list[str]
+
+ +
+
+property dot_env: str
+
+ +
+
+expand_env_vars(value)
+
+ +
+
+extra_data: dict[str, Any]
+
+ +
+
+find_contract(contract_or_contract_path: str) Path
+
+ +
+
+static find_project_root(start_path: Path | str | None = None) Path
+
+ +
+
+get_active_network() Network
+
+ +
+
+get_base_dependencies_install_path() Path
+
+ +
+
+get_config_path() Path
+
+ +
+
+get_db_path() Path
+
+ +
+
+get_dependencies() list[str]
+
+ +
+
+get_networks() dict[str, Network]
+
+ +
+
+get_or_deploy_contract(*args, **kwargs) VyperContract | ZksyncContract | ABIContract
+
+ +
+
+get_root() Path
+
+ +
+
+property lib_folder: str
+
+ +
+
+static load_config_from_root(project_root: Path | None = None) Config
+
+ +
+
+static merge_configs(moccasin_config_dict: dict | TOMLDocument, pyproject_config_dict: dict | TOMLDocument) dict | TOMLDocument
+
+ +
+
+static nested_tomlkit_update(toml_data: TOMLDocument, keys: list, value: str | int | float | bool | list | dict) TOMLDocument
+
+ +
+
+networks: _Networks
+
+ +
+
+property out_folder: str
+
+ +
+
+project: dict[str, str]
+
+ +
+
+property project_root: Path
+
+ +
+
+property pyproject_path: Path
+
+ +
+
+read_configs(moccasin_path: Path | None = None, pyproject_path: Path | None = None) dict
+
+ +
+
+read_configs_preserve_comments(moccasin_config_path: Path | None = None, pyproject_config_path: Path | None = None) TOMLDocument
+
+ +
+
+read_moccasin_config(config_path: Path | None = None) dict
+
+ +
+
+static read_moccasin_toml(config_path: Path) dict
+
+ +
+
+static read_moccasin_toml_preserve_comments(config_path: Path) TOMLDocument
+
+ +
+
+read_pyproject_config(pyproject_path: Path | None = None) dict
+
+ +
+
+static read_pyproject_toml(pyproject_path: Path) dict
+
+ +
+
+static read_pyproject_toml_preserve_comments(config_path: Path) TOMLDocument
+
+ +
+
+property script_folder: str
+
+ +
+
+set_active_network(name_url_or_id: str | Network, activate_boa=True, activate_db=True, **kwargs) Network
+
+ +
+
+property src_folder: str
+
+ +
+
+property test_folder: str
+
+ +
+
+write_dependencies(dependencies: list)
+

Writes the dependencies to the config file.

+

If a moccasin.toml file exists, it will write there, otherwise, it’ll write to pyproject.toml.

+

This will overwrite the existing dependencies with the new ones. So if you wish to keep old ones, +read from the dependencies first.

+
+ +
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/api_reference/moccasin_account_reference.html b/api_reference/moccasin_account_reference.html new file mode 100644 index 0000000..78bbbfd --- /dev/null +++ b/api_reference/moccasin_account_reference.html @@ -0,0 +1,322 @@ + + + + + MoccasinAccount - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

MoccasinAccount

+
+
+class moccasin.moccasin_account.MoccasinAccount(private_key: str | bytes | None = None, keystore_path_or_account_name: Path | str | None = None, password: str = None, password_file_path: Path = None, address: Address | None = None, ignore_warning: bool = False)
+

Bases: LocalAccount

+
+
+property address: ChecksumAddress | None
+

The checksummed public address for this account.

+
>>> my_account.address 
+"0xF0109fC8DF283027b6285cc889F5aA624EaC1F55"
+
+
+
+ +
+
+classmethod from_boa_address(address: Address) MoccasinAccount
+
+ +
+
+property private_key: bytes
+
+ +
+
+set_keystore_path(keystore_path: Path | str)
+
+ +
+
+unlock(password: str = None, password_file_path: Path = None, prompt_even_if_unlocked: bool = False) HexBytes
+
+ +
+
+unlocked() bool
+
+ +
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/api_reference/named_contract_reference.html b/api_reference/named_contract_reference.html new file mode 100644 index 0000000..d58ee21 --- /dev/null +++ b/api_reference/named_contract_reference.html @@ -0,0 +1,347 @@ + + + + + NamedContract - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

NamedContract

+
+
+class moccasin.named_contract.NamedContract(contract_name: str, force_deploy: bool | None = None, abi: str | None = None, abi_from_explorer: bool | None = None, deployer_script: str | pathlib._local.Path | None = None, address: str | None = None, vyper_contract: boa.contracts.vyper.vyper_contract.VyperContract | None = None, vyper_deployer: boa.contracts.vyper.vyper_contract.VyperDeployer | None = None)
+

Bases: object

+
+
+abi: str | None = None
+
+ +
+
+abi_from_explorer: bool | None = None
+
+ +
+
+address: str | None = None
+
+ +
+
+contract_name: str
+
+ +
+
+deployer_script: str | Path | None = None
+
+ +
+
+force_deploy: bool | None = None
+
+ +
+
+get(key: str, otherwise: Any)
+
+ +
+
+set_defaults(other: NamedContract)
+
+ +
+
+update_from_deployed_contract(deployed_contract: VyperContract)
+
+ +
+
+vyper_contract: VyperContract | None = None
+
+ +
+
+vyper_deployer: VyperDeployer | None = None
+
+ +
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/api_reference/network_reference.html b/api_reference/network_reference.html new file mode 100644 index 0000000..5ced0f1 --- /dev/null +++ b/api_reference/network_reference.html @@ -0,0 +1,562 @@ + + + + + Network - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Network

+
+
+class moccasin.config.Network(name: str, url: str | None = None, chain_id: int | None = None, is_fork: bool = False, is_zksync: bool = False, default_account_name: str | None = None, unsafe_password_file: pathlib._local.Path | None = None, save_abi_path: str | None = None, explorer_uri: str | None = None, explorer_api_key: str | None = None, explorer_type: str | None = None, contracts: dict[str, moccasin.named_contract.NamedContract] = <factory>, prompt_live: bool = True, save_to_db: bool = True, live_or_staging: bool = True, db_path: str | pathlib._local.Path = ':memory:', extra_data: dict[str, typing.Any] = <factory>, _network_env: Union[ForwardRef('NetworkEnv'), ForwardRef('Env'), ForwardRef('ZksyncEnv'), NoneType] = None)
+

Bases: object

+
+
+property alias: str
+
+ +
+
+chain_id: int | None = None
+
+ +
+
+contracts: dict[str, NamedContract]
+
+ +
+
+static convert_deployment_to_contract(deployment: Deployment) ABIContract
+
+ +
+
+create_and_set_or_set_boa_env(**kwargs) NetworkEnv | Env | ZksyncEnv
+
+ +
+
+db_path: str | Path = ':memory:'
+
+ +
+
+default_account_name: str | None = None
+
+ +
+
+explorer_api_key: str | None = None
+
+ +
+
+explorer_type: str | None = None
+
+ +
+
+explorer_uri: str | None = None
+
+ +
+
+extra_data: dict[str, Any]
+
+ +
+
+get_default_account() MoccasinAccount | Any
+

Returns an ‘account-like’ object.

+
+ +
+
+get_deployer_from_contract_name(config: Config, contract_name: str) VyperDeployer | ZksyncDeployer
+
+ +
+
+get_deployments_checked(contract_name: str | None = None, limit: int | None = None, chain_id: int | str | None = None, config_or_db_path: Config | Path | str | None = None) list[Deployment]
+
+ +
+
+get_deployments_unchecked(contract_name: str | None = None, limit: int | None = None, chain_id: int | str | None = None, config_or_db_path: Config | Path | str | None = None) list[Deployment]
+
+ +
+
+get_latest_contract_checked(contract_name: str | None = None, chain_id: int | str | None = None) ABIContract | None
+
+ +
+
+get_latest_contract_unchecked(contract_name: str | None = None, chain_id: int | str | None = None) ABIContract | None
+
+ +
+
+get_latest_deployment_checked(contract_name: str | None = None, chain_id: int | str | None = None) Deployment | None
+
+ +
+
+get_latest_deployment_unchecked(contract_name: str | None = None, chain_id: int | str | None = None) Deployment | None
+
+ +
+
+get_named_contract(contract_name: str) NamedContract | None
+
+ +
+
+get_named_contracts() dict
+
+ +
+
+get_or_deploy_contract(contract_name: str, force_deploy: bool = False, abi: str | Path | list | VyperDeployer | VyperContract | ZksyncContract | ZksyncDeployer | ABIContractFactory | ABIContract | None = None, abi_from_explorer: bool | None = None, deployer_script: str | Path | None = None, address: str | None = None, checked: bool = False) VyperContract | ZksyncContract | ABIContract
+

Returns or deploys a VyperContract, ZksyncContract, or ABIContract based on the name and address in the config file, or passed to this function.

+
+
The following arguments are mutually exclusive:
    +
  • abi

  • +
  • abi_from_explorer

  • +
+
+
Args:
    +
  • contract_name: the contract name or deployer for the contract.

  • +
  • force_deploy: if True, will deploy the contract even if the contract has an address in the config file.

  • +
  • abi: the ABI of the contract. Can be a list, string path to file, string of the ABI, VyperDeployer, VyperContract, ZksyncDeployer, ZksyncContract, ABIContractFactory, or ABIContract.

  • +
  • abi_from_explorer: if True, will fetch the ABI from the explorer.

  • +
  • deployer_script: If no address is given, this is the path to deploy the contract.

  • +
  • address: The address of the contract.

  • +
+
+
Returns:

VyperContract | ZksyncContract | ABIContract: The deployed contract instance, or a blank contract if the contract is not found.

+
+
+
+ +
+
+get_verifier_class() Any
+
+ +
+
+has_explorer() bool
+
+ +
+
+has_matching_integrity(deployment: Deployment, contract_name: str | None, config: Config | None = None) bool
+
+ +
+
+property identifier: str
+
+ +
+
+instantiate_contract(*args, **kwargs) VyperContract | ZksyncContract | ABIContract
+

An alias for get_or_deploy_contract.

+
+ +
+
+is_fork: bool = False
+
+ +
+
+is_local_or_forked_network() bool
+

Returns True if network is: +1. pyevm +2. eravm +3. A fork

+
+ +
+
+is_matching_boa() bool
+

Returns True if the current network is the active network in boa. +This is a good way to test if you’ve overriden boa as the “active” network.

+
+ +
+
+is_zksync: bool = False
+
+ +
+
+live_or_staging: bool = True
+
+ +
+
+manifest_contract(contract_name: str, force_deploy: bool = False, address: str | None = None, checked: bool = False) VyperContract | ZksyncContract | ABIContract
+

A wrapper around get_or_deploy_contract that is more explicit about the contract being deployed.

+
+ +
+
+moccasin_verify(contract: VyperContract | ZksyncContract) VerificationResult
+

Verifies a contract using your moccasin.toml config.

+
+ +
+
+name: str
+
+ +
+
+prompt_live: bool = True
+
+ +
+
+save_abi_path: str | None = None
+
+ +
+
+save_to_db: bool = True
+
+ +
+
+set_boa_eoa(account: MoccasinAccount)
+
+ +
+
+set_kwargs(**kwargs)
+
+ +
+
+unsafe_password_file: Path | None = None
+
+ +
+
+url: str | None = None
+
+ +
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/api_reference/networks_reference.html b/api_reference/networks_reference.html new file mode 100644 index 0000000..06745c8 --- /dev/null +++ b/api_reference/networks_reference.html @@ -0,0 +1,353 @@ + + + + + _Networks - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

_Networks

+
+
+class moccasin.config._Networks(toml_data: dict, db_path: Path)
+

Bases: object

+
+
+activate_boa()
+
+ +
+
+activate_db()
+
+ +
+
+db_path: Path
+
+ +
+
+default_network_name: str
+
+ +
+
+get_active_network() Network
+
+ +
+
+get_db_path() Path
+
+ +
+
+get_network(network_name_or_id: str | int) Network
+
+ +
+
+get_network_by_chain_id(chain_id: int) Network
+
+ +
+
+get_network_by_name(alias: str) Network
+
+ +
+
+get_networks() dict[str, Network]
+
+ +
+
+get_or_deploy_contract(*args, **kwargs) VyperContract | ZksyncContract | ABIContract
+
+ +
+
+set_active_network(name_of_network_or_network: str | Network, activate_boa=True, activate_db=True, **kwargs) Network
+
+ +
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/class_reference.html b/class_reference.html new file mode 100644 index 0000000..c3342a1 --- /dev/null +++ b/class_reference.html @@ -0,0 +1,282 @@ + + + + + Classes Reference - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/cli_commands.html b/cli_commands.html new file mode 100644 index 0000000..353a829 --- /dev/null +++ b/cli_commands.html @@ -0,0 +1,1340 @@ + + + + + CLI Command Reference - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

CLI Command Reference

+
+

mox

+

🐍 Pythonic Smart Contract Development Framework

+

+
usage: mox [-h] [-d] [-q]
+           {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util} ...
+
+
+
+

Positional Arguments

+
+
command
+

Possible choices: init, compile, build, test, run, script, deploy, wallet, console, install, purge, config, explorer, inspect, deployments, utils, u, util

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+

Sub-commands

+
+

init

+

This will create a basic directory structure at the path you specific, which looks like: +. +├── README.md +├── moccasin.toml +├── script +│ └── deploy.py +├── src +│ └── Counter.vy +└── tests

+
+

├── conftest.py +└── test_counter.py

+
+
mox init [-h] [-d] [-q] [-f] [--vscode] [--pyproject] [path]
+
+
+
+
Positional Arguments
+
+
path
+

Path of the new project, defaults to current directory.

+

Default: .

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
-f, --force
+

Overwrite existing project.

+

Default: False

+
+
--vscode
+

Add a .vscode/settings.json file.

+

Default: False

+
+
--pyproject
+

Add a pyproject.toml file.

+

Default: False

+
+
+
+
+
+

compile (build)

+

Compiles a specific Vyper contract or all vyper contracts in the project.

+

If no contract or contract path is given, this command will: +1. Find all .vy files in the src/ directory +2. Compile each file using the Vyper compiler +3. Output the compiled artifacts to the out/ directory

+

Use this command to prepare your contracts for deployment or testing.

+
mox compile [-h] [-d] [-q] [--network NETWORK | --is_zksync [IS_ZKSYNC]]
+            [contract_or_contract_path]
+
+
+
+
Positional Arguments
+
+
contract_or_contract_path
+

Optional argument to compile a specific contract.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--is_zksync
+
+
+
+
+
+

test

+

Runs pytest with boa context.

+
mox test [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL |
+         --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+         [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+         --private-key PRIVATE_KEY] [--password PASSWORD |
+         --password-file-path PASSWORD_FILE_PATH] [--gas-profile] [-k [K]]
+         [-m [M]] [-x] [-s] [--capture  [CAPTURE ]] [--lf] [--cache-clear]
+         [--disable-warnings] [--full-trace] [--pdb] [--coverage] [--cov COV]
+         [--cov-report [COV_REPORT ...]] [--cov-config COV_CONFIG]
+         [--no-cov-on-fail] [--no-cov] [--cov-reset]
+         [--cov-fail-under COV_FAIL_UNDER] [--cov-append] [--cov-branch]
+         [--cov-context COV_CONTEXT]
+         [file_or_dir]
+
+
+
+
Positional Arguments
+
+
file_or_dir
+

Name of the test or folder to run tests on, or the path to your script.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
--gas-profile
+

Get an output on gas use for test functions.

+

Default: False

+
+
-k
+
+
Only run tests which match the given substring expression. An expression is a Python evaluable expression where all names are

substring-matched against test names and their parent classes. Example: -k ‘test_method or test_other’ matches all test functions and +classes whose name contains ‘test_method’ or ‘test_other’, while -k ‘not test_method’ matches those that don’t contain ‘test_method’ in +their names. -k ‘not test_method and not test_other’ will eliminate the matches. Additionally keywords are matched to classes and +functions containing extra names in their ‘extra_keyword_matches’ set, as well as functions which have names assigned directly to them. +The matching is case-insensitive.

+
+
+
+
-m
+

Only run tests matching given mark expression. For example: -m ‘mark1 and not mark2’.

+
+
-x, --exitfirst
+

Exit instantly on first error or failed test.

+

Default: False

+
+
-s
+

A way to show print lines from tests. Shortcut for –capture=no

+

Default: False

+
+
--capture
+

Per-test capturing method: one of fd|sys|no|tee-sys

+
+
--lf, --last-failed
+

Rerun only the tests that failed at the last run (or all if none failed).

+

Default: False

+
+
--cache-clear
+

Remove all cache contents at start of test run.

+

Default: False

+
+
--disable-warnings, --disable-pytest-warnings
+

Disable warnings summary.

+

Default: False

+
+
--full-trace
+

Don’t cut any tracebacks (default is to cut)

+

Default: False

+
+
--pdb
+

Start the debugger for each test that fails.

+

Default: False

+
+
--coverage
+

Shorthand for adding –cov=. –cov-branch.

+

Default: False

+
+
--cov
+

Coverage target directory.

+
+
--cov-report
+

Type of report to generate: term, term-missing, annotate, html, xml, json, lcov (multi-allowed). term, term- missing may be followed by “:skip-covered”. annotate, html, xml, json and lcov may be followed by “:DEST” where DEST specifies the output location. Use –cov-report= to not generate any output..

+
+
--cov-config
+

Coverage config file, defaults to a moccasin internal config file loading the boa plugin.

+
+
--no-cov-on-fail
+

Do not report coverage if test run fails.

+

Default: False

+
+
--no-cov
+

Disable coverage report.

+

Default: False

+
+
--cov-reset
+

Reset cov sources accumulated in options so far. Mostly useful for scripts and configuration files.

+

Default: False

+
+
--cov-fail-under
+

Fail if the total coverage is less than this value.

+
+
--cov-append
+

Do not delete coverage but append to current. Default: False.

+

Default: False

+
+
--cov-branch
+

Enable branch coverage.

+

Default: False

+
+
--cov-context
+

Coverage context to add to the coverage data.

+
+
+
+
+
+

run (script)

+

Runs a script with the project’s context.

+
mox run [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL |
+        --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+        [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+        --private-key PRIVATE_KEY] [--password PASSWORD |
+        --password-file-path PASSWORD_FILE_PATH]
+        script_name_or_path
+
+
+
+
Positional Arguments
+
+
script_name_or_path
+

Name of the script in the script folder, or the path to your script.

+

Default: './script/deploy.py'

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+
+

deploy

+

Deploys a contract named in the config with a deploy script.

+
mox deploy [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL |
+           --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+           [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+           --private-key PRIVATE_KEY] [--password PASSWORD |
+           --password-file-path PASSWORD_FILE_PATH]
+           contract_name
+
+
+
+
Positional Arguments
+
+
contract_name
+

Name of contract in your moccasin.toml to deploy.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+
+

wallet

+

Wallet management utilities.

+
mox wallet [-h] [-d] [-q]
+           {list,ls,generate,g,new,import,i,add,view,decrypt,dk,delete,d} ...
+
+
+
+
Positional Arguments
+
+
wallet_command
+

Possible choices: list, ls, generate, g, new, import, i, add, view, decrypt, dk, delete, d

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
Sub-commands
+
+
list (ls)
+

List all the accounts in the keystore default directory

+
mox wallet list [-h]
+
+
+
+
+
generate (g, new)
+

Create a new account with a random private key

+
mox wallet generate [-h] [--save] [--password PASSWORD |
+                    --password-file PASSWORD_FILE]
+                    name
+
+
+
+
Positional Arguments
+
+
name
+

Name of account

+
+
+
+
+
Named Arguments
+
+
--save
+

Save to keystore

+

Default: False

+
+
--password
+

Password for the keystore

+
+
--password-file
+

File containing the password for the keystore

+
+
+
+
+
+
import (i, add)
+

Import a private key into an encrypted keystore

+
mox wallet import [-h] name
+
+
+
+
Positional Arguments
+
+
name
+

Name of account to import

+
+
+
+
+
+
view
+

View the JSON of a keystore file

+
mox wallet view [-h] keystore_file_name
+
+
+
+
Positional Arguments
+
+
keystore_file_name
+

Name of keystore file

+
+
+
+
+
+
decrypt (dk)
+

Decrypt a keystore file to get the private key

+
mox wallet decrypt [-h] [--password PASSWORD |
+                   --password-file-path PASSWORD_FILE_PATH] [--print-key]
+                   keystore_file_name
+
+
+
+
Positional Arguments
+
+
keystore_file_name
+

Name of the keystore file to decrypt

+
+
+
+
+
Named Arguments
+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
--print-key, -p
+

Print the private key to the console

+

Default: False

+
+
+
+
+
+
delete (d)
+

Delete a keystore file

+
mox wallet delete [-h] keystore_file_name
+
+
+
+
Positional Arguments
+
+
keystore_file_name
+

Name of keystore file

+
+
+
+
+
+
+
+

console

+

BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.

+
mox console [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL |
+            --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+            [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+            --private-key PRIVATE_KEY] [--password PASSWORD |
+            --password-file-path PASSWORD_FILE_PATH]
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+
+

install

+

Installs the project’s dependencies. The first argument is the requirements, given as a pip-compatible strings and/or moccasin github formatted dependencies. +- Pip-compatible strings download dependencies as regular python packages from PyPI. +- Moccasin github formatted dependencies download dependencies from the Moccasin github repository.

+

Moccasin github formatted dependencies are formatted as:

+

GITHUB_ORG/GITHUB_REPO@[@VERSION]

+

Where: +- GITHUB_ORG is the github organization or user that owns the repository. +- GITHUB_REPO is the name of the repository. +- VERSION is the optional version of the repository to download. If not provided, the latest version is downloaded.

+

Examples: +- pcaversaccio/snekmate@0.1.0 # Moccasin GitHub formatted dependency +- snekmate==0.1.0 # Pip-compatible string

+
mox install [-h] [-d] [-q] [requirements ...]
+
+
+
+
Positional Arguments
+
+
requirements
+

Requirements, given as a pip-compatible strings and/or moccasin github formatted dependencies.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
+

purge

+

Purge the given dependency.

+
mox purge [-h] [-d] [-q] packages [packages ...]
+
+
+
+
Positional Arguments
+
+
packages
+

Package name, given as a pip-compatible string and/or moccasin github formatted dependency.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
+

config

+

View the Moccasin configuration.

+
mox config [-h] [-d] [-q]
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
+

explorer

+

Work with block explorers to get data.

+
mox explorer [-h] [-d] [-q] {fetch,get,list} ...
+
+
+
+
Positional Arguments
+
+
explorer_command
+

Possible choices: fetch, get, list

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
Sub-commands
+
+
fetch (get)
+

Retreive the ABI of a contract from a block explorer.

+

This command will attempt to use the environment variable ETHERSCAN_API_KEY as the API key for Etherscan. If this environment variable is not set, you can provide the API key as an argument to the command.

+
mox explorer fetch [-h] [-d] [-q] [--name NAME] [--api-key API_KEY]
+                   [--ignore-config] [--save-abi-path SAVE_ABI_PATH] [--save]
+                   [--uri URI | --network NETWORK]
+                   address
+
+
+
+
Positional Arguments
+
+
address
+

The address you want to pull from.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--name
+

Optional name for the contract.

+
+
--api-key, --explorer-api-key
+

API key for the block explorer.

+
+
--ignore-config, -i
+

Don’t pull values from the config.

+

Default: False

+
+
--save-abi-path
+

Location to save the returned abi. This will only be applied if you also add the ‘–save’ flag.

+
+
--save
+

If added, the ABI will be saved to the ‘save-abi-path’ given in the command line or config.

+

Default: False

+
+
--uri
+

API URI endpoint for explorer.

+
+
--network
+

Name/alias of the network (from the moccasin.toml). If chain_id is set in the config, you may also use that.

+
+
+
+
+
+
list
+

List all natively supported block explorers and chains.

+
mox explorer list [-h] [--by-id] [--json]
+
+
+
+
Named Arguments
+
+
--by-id
+

List by chain id.

+

Default: False

+
+
--json
+

Format as json.

+

Default: False

+
+
+
+
+
+
+
+

inspect

+

Inspect compiler data of a contract.

+
+

This command will directly use the Vyper compiler to access this data. For example, to get function signatures and selectors run:

+
+

mox inspect src/Counter.vy methods

+
+

or

+
+

mox inspect Counter methods

+
+
+
mox inspect [-h]
+            contract
+            {methods,abi,natspec,storage-layout,ir-nodes,ir-runtime,function-signatures,function-selectors,selectors,signatures,assembly,venom-functions,bytecode,bytecode-runtime}
+
+
+
+
Positional Arguments
+
+
contract
+

Path or Contract name of the contract you want to inspect.

+
+
inspect_type
+

Possible choices: methods, abi, natspec, storage-layout, ir-nodes, ir-runtime, function-signatures, function-selectors, selectors, signatures, assembly, venom-functions, bytecode, bytecode-runtime

+

Type of inspection you want to do.

+
+
+
+
+
+

deployments

+

View deployments of the project from your DB.

+
+

The –format-level will determine how much information you want to print based on your deployment.

+

Format levels: +- 0: Contract Address +- 1: Contract Address and Name +- 2: Contract Address, Name, and Source Code +- 3: Everything +- 4: Raw JSON

+
+
mox deployments [-h] [-d] [-q] [--format-level FORMAT_LEVEL] [--checked]
+                [--limit LIMIT] [--fork [FORK]] [--network NETWORK |
+                --url URL | --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+                [--save-to-db [SAVE_TO_DB]]
+                contract_name
+
+
+
+
Positional Arguments
+
+
contract_name
+

Name of the contract to get, or “all”.

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--format-level, -f
+

Format level of how much information you want to print based on your deployment.

+

Default: 1

+
+
--checked
+

Only return contracts that match the current edition of the code by comparing integrity hashes.

+

Default: False

+
+
--limit
+

Limit the number of deployments to get.

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
+
+
+
+

utils (u, util)

+

Helpful utilities.

+
mox utils [-h] [-d] [-q]
+          {zero,zero-address,zero_address,address-zero,address_zero} ...
+
+
+
+
Positional Arguments
+
+
utils_command
+

Possible choices: zero, zero-address, zero_address, address-zero, address_zero

+
+
+
+
+
Named Arguments
+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+
Sub-commands
+
+
zero (zero-address, zero_address, address-zero, address_zero)
+

Get the zero address.

+
mox utils zero [-h]
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/compile.html b/cli_reference/compile.html new file mode 100644 index 0000000..6d83d11 --- /dev/null +++ b/cli_reference/compile.html @@ -0,0 +1,312 @@ + + + + + compile - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

compile

+

Compiles a specific Vyper contract or all vyper contracts in the project.

+

If no contract or contract path is given, this command will: +1. Find all .vy files in the src/ directory +2. Compile each file using the Vyper compiler +3. Output the compiled artifacts to the out/ directory

+

Use this command to prepare your contracts for deployment or testing.

+

+
usage: mox compile [-h] [-d] [-q] [--network NETWORK |
+                   --is_zksync [IS_ZKSYNC]]
+                   [contract_or_contract_path]
+
+
+
+

Positional Arguments

+
+
contract_or_contract_path
+

Optional argument to compile a specific contract.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--is_zksync
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/config.html b/cli_reference/config.html new file mode 100644 index 0000000..a1dd922 --- /dev/null +++ b/cli_reference/config.html @@ -0,0 +1,291 @@ + + + + + config - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

config

+

View the Moccasin configuration.

+

+
usage: mox config [-h] [-d] [-q]
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/console.html b/cli_reference/console.html new file mode 100644 index 0000000..7a28937 --- /dev/null +++ b/cli_reference/console.html @@ -0,0 +1,325 @@ + + + + + console - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

console

+

BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.

+

+
usage: mox console [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK |
+                   --url URL | --prompt-live [PROMPT_LIVE]]
+                   [--db-path DB_PATH] [--save-to-db [SAVE_TO_DB]]
+                   [--account ACCOUNT | --private-key PRIVATE_KEY]
+                   [--password PASSWORD |
+                   --password-file-path PASSWORD_FILE_PATH]
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/deploy.html b/cli_reference/deploy.html new file mode 100644 index 0000000..db77517 --- /dev/null +++ b/cli_reference/deploy.html @@ -0,0 +1,334 @@ + + + + + deploy - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

deploy

+

Deploys a contract named in the config with a deploy script.

+

+
usage: mox deploy [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK |
+                  --url URL | --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+                  [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+                  --private-key PRIVATE_KEY] [--password PASSWORD |
+                  --password-file-path PASSWORD_FILE_PATH]
+                  contract_name
+
+
+
+

Positional Arguments

+
+
contract_name
+

Name of contract in your moccasin.toml to deploy.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/deployments.html b/cli_reference/deployments.html new file mode 100644 index 0000000..f4e22bc --- /dev/null +++ b/cli_reference/deployments.html @@ -0,0 +1,342 @@ + + + + + deployments - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

deployments

+

View deployments of the project from your DB.

+
+

The –format-level will determine how much information you want to print based on your deployment.

+

Format levels: +- 0: Contract Address +- 1: Contract Address and Name +- 2: Contract Address, Name, and Source Code +- 3: Everything +- 4: Raw JSON

+
+

+
usage: mox deployments [-h] [-d] [-q] [--format-level FORMAT_LEVEL]
+                       [--checked] [--limit LIMIT] [--fork [FORK]]
+                       [--network NETWORK | --url URL |
+                       --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+                       [--save-to-db [SAVE_TO_DB]]
+                       contract_name
+
+
+
+

Positional Arguments

+
+
contract_name
+

Name of the contract to get, or “all”.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--format-level, -f
+

Format level of how much information you want to print based on your deployment.

+

Default: 1

+
+
--checked
+

Only return contracts that match the current edition of the code by comparing integrity hashes.

+

Default: False

+
+
--limit
+

Limit the number of deployments to get.

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/explorer.html b/cli_reference/explorer.html new file mode 100644 index 0000000..78afdec --- /dev/null +++ b/cli_reference/explorer.html @@ -0,0 +1,390 @@ + + + + + explorer - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

explorer

+

Work with block explorers to get data.

+

+
usage: mox explorer [-h] [-d] [-q] {fetch,get,list} ...
+
+
+
+

Positional Arguments

+
+
explorer_command
+

Possible choices: fetch, get, list

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+

Sub-commands

+
+

fetch (get)

+

Retreive the ABI of a contract from a block explorer.

+

This command will attempt to use the environment variable ETHERSCAN_API_KEY as the API key for Etherscan. If this environment variable is not set, you can provide the API key as an argument to the command.

+
mox explorer fetch [-h] [-d] [-q] [--name NAME] [--api-key API_KEY]
+                   [--ignore-config] [--save-abi-path SAVE_ABI_PATH] [--save]
+                   [--uri URI | --network NETWORK]
+                   address
+
+
+
+

Positional Arguments

+
+
address
+

The address you want to pull from.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--name
+

Optional name for the contract.

+
+
--api-key, --explorer-api-key
+

API key for the block explorer.

+
+
--ignore-config, -i
+

Don’t pull values from the config.

+

Default: False

+
+
--save-abi-path
+

Location to save the returned abi. This will only be applied if you also add the ‘–save’ flag.

+
+
--save
+

If added, the ABI will be saved to the ‘save-abi-path’ given in the command line or config.

+

Default: False

+
+
--uri
+

API URI endpoint for explorer.

+
+
--network
+

Name/alias of the network (from the moccasin.toml). If chain_id is set in the config, you may also use that.

+
+
+
+
+
+

list

+

List all natively supported block explorers and chains.

+
mox explorer list [-h] [--by-id] [--json]
+
+
+
+

Named Arguments

+
+
--by-id
+

List by chain id.

+

Default: False

+
+
--json
+

Format as json.

+

Default: False

+
+
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/init.html b/cli_reference/init.html new file mode 100644 index 0000000..6a899a6 --- /dev/null +++ b/cli_reference/init.html @@ -0,0 +1,325 @@ + + + + + init - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

init

+

This will create a basic directory structure at the path you specific, which looks like: +. +├── README.md +├── moccasin.toml +├── script +│ └── deploy.py +├── src +│ └── Counter.vy +└── tests

+
+

├── conftest.py +└── test_counter.py

+
+

+
usage: mox init [-h] [-d] [-q] [-f] [--vscode] [--pyproject] [path]
+
+
+
+

Positional Arguments

+
+
path
+

Path of the new project, defaults to current directory.

+

Default: .

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
-f, --force
+

Overwrite existing project.

+

Default: False

+
+
--vscode
+

Add a .vscode/settings.json file.

+

Default: False

+
+
--pyproject
+

Add a pyproject.toml file.

+

Default: False

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/inspect.html b/cli_reference/inspect.html new file mode 100644 index 0000000..1398228 --- /dev/null +++ b/cli_reference/inspect.html @@ -0,0 +1,302 @@ + + + + + inspect - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

inspect

+

Inspect compiler data of a contract.

+
+

This command will directly use the Vyper compiler to access this data. For example, to get function signatures and selectors run:

+
+

mox inspect src/Counter.vy methods

+
+

or

+
+

mox inspect Counter methods

+
+
+

+
usage: mox inspect [-h]
+                   contract
+                   {methods,abi,natspec,storage-layout,ir-nodes,ir-runtime,function-signatures,function-selectors,selectors,signatures,assembly,venom-functions,bytecode,bytecode-runtime}
+
+
+
+

Positional Arguments

+
+
contract
+

Path or Contract name of the contract you want to inspect.

+
+
inspect_type
+

Possible choices: methods, abi, natspec, storage-layout, ir-nodes, ir-runtime, function-signatures, function-selectors, selectors, signatures, assembly, venom-functions, bytecode, bytecode-runtime

+

Type of inspection you want to do.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/install.html b/cli_reference/install.html new file mode 100644 index 0000000..ab1aca3 --- /dev/null +++ b/cli_reference/install.html @@ -0,0 +1,311 @@ + + + + + install - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

install

+

Installs the project’s dependencies. The first argument is the requirements, given as a pip-compatible strings and/or moccasin github formatted dependencies. +- Pip-compatible strings download dependencies as regular python packages from PyPI. +- Moccasin github formatted dependencies download dependencies from the Moccasin github repository.

+

Moccasin github formatted dependencies are formatted as:

+

GITHUB_ORG/GITHUB_REPO@[@VERSION]

+

Where: +- GITHUB_ORG is the github organization or user that owns the repository. +- GITHUB_REPO is the name of the repository. +- VERSION is the optional version of the repository to download. If not provided, the latest version is downloaded.

+

Examples: +- pcaversaccio/snekmate@0.1.0 # Moccasin GitHub formatted dependency +- snekmate==0.1.0 # Pip-compatible string

+

+
usage: mox install [-h] [-d] [-q] [requirements ...]
+
+
+
+

Positional Arguments

+
+
requirements
+

Requirements, given as a pip-compatible strings and/or moccasin github formatted dependencies.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/purge.html b/cli_reference/purge.html new file mode 100644 index 0000000..0c7eca0 --- /dev/null +++ b/cli_reference/purge.html @@ -0,0 +1,300 @@ + + + + + purge - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

purge

+

Purge the given dependency.

+

+
usage: mox purge [-h] [-d] [-q] packages [packages ...]
+
+
+
+

Positional Arguments

+
+
packages
+

Package name, given as a pip-compatible string and/or moccasin github formatted dependency.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/run.html b/cli_reference/run.html new file mode 100644 index 0000000..9934bb5 --- /dev/null +++ b/cli_reference/run.html @@ -0,0 +1,335 @@ + + + + + run - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

run

+

Runs a script with the project’s context.

+

+
usage: mox run [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL |
+               --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+               [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+               --private-key PRIVATE_KEY] [--password PASSWORD |
+               --password-file-path PASSWORD_FILE_PATH]
+               script_name_or_path
+
+
+
+

Positional Arguments

+
+
script_name_or_path
+

Name of the script in the script folder, or the path to your script.

+

Default: './script/deploy.py'

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/test.html b/cli_reference/test.html new file mode 100644 index 0000000..2daa11c --- /dev/null +++ b/cli_reference/test.html @@ -0,0 +1,427 @@ + + + + + test - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

test

+

Runs pytest with boa context.

+

+
usage: mox test [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK |
+                --url URL | --prompt-live [PROMPT_LIVE]] [--db-path DB_PATH]
+                [--save-to-db [SAVE_TO_DB]] [--account ACCOUNT |
+                --private-key PRIVATE_KEY] [--password PASSWORD |
+                --password-file-path PASSWORD_FILE_PATH] [--gas-profile]
+                [-k [K]] [-m [M]] [-x] [-s] [--capture  [CAPTURE ]] [--lf]
+                [--cache-clear] [--disable-warnings] [--full-trace] [--pdb]
+                [--coverage] [--cov COV] [--cov-report [COV_REPORT ...]]
+                [--cov-config COV_CONFIG] [--no-cov-on-fail] [--no-cov]
+                [--cov-reset] [--cov-fail-under COV_FAIL_UNDER] [--cov-append]
+                [--cov-branch] [--cov-context COV_CONTEXT]
+                [file_or_dir]
+
+
+
+

Positional Arguments

+
+
file_or_dir
+

Name of the test or folder to run tests on, or the path to your script.

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
--fork
+
+
--network
+

Alias of the network (from the moccasin.toml).

+
+
--url, --rpc
+

RPC URL to run the script on.

+
+
--prompt-live
+

Prompt the user to make sure they want to run this script.

+
+
--db-path
+

The location of your database, defaults to your working project’s database in your {CONFIG_NAME}.

+
+
--save-to-db
+

Save the deployment to the database.

+
+
--account
+

Keystore account you want to use.

+
+
--private-key
+

Private key you want to use to get an unlocked account.

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
--gas-profile
+

Get an output on gas use for test functions.

+

Default: False

+
+
-k
+
+
Only run tests which match the given substring expression. An expression is a Python evaluable expression where all names are

substring-matched against test names and their parent classes. Example: -k ‘test_method or test_other’ matches all test functions and +classes whose name contains ‘test_method’ or ‘test_other’, while -k ‘not test_method’ matches those that don’t contain ‘test_method’ in +their names. -k ‘not test_method and not test_other’ will eliminate the matches. Additionally keywords are matched to classes and +functions containing extra names in their ‘extra_keyword_matches’ set, as well as functions which have names assigned directly to them. +The matching is case-insensitive.

+
+
+
+
-m
+

Only run tests matching given mark expression. For example: -m ‘mark1 and not mark2’.

+
+
-x, --exitfirst
+

Exit instantly on first error or failed test.

+

Default: False

+
+
-s
+

A way to show print lines from tests. Shortcut for –capture=no

+

Default: False

+
+
--capture
+

Per-test capturing method: one of fd|sys|no|tee-sys

+
+
--lf, --last-failed
+

Rerun only the tests that failed at the last run (or all if none failed).

+

Default: False

+
+
--cache-clear
+

Remove all cache contents at start of test run.

+

Default: False

+
+
--disable-warnings, --disable-pytest-warnings
+

Disable warnings summary.

+

Default: False

+
+
--full-trace
+

Don’t cut any tracebacks (default is to cut)

+

Default: False

+
+
--pdb
+

Start the debugger for each test that fails.

+

Default: False

+
+
--coverage
+

Shorthand for adding –cov=. –cov-branch.

+

Default: False

+
+
--cov
+

Coverage target directory.

+
+
--cov-report
+

Type of report to generate: term, term-missing, annotate, html, xml, json, lcov (multi-allowed). term, term- missing may be followed by “:skip-covered”. annotate, html, xml, json and lcov may be followed by “:DEST” where DEST specifies the output location. Use –cov-report= to not generate any output..

+
+
--cov-config
+

Coverage config file, defaults to a moccasin internal config file loading the boa plugin.

+
+
--no-cov-on-fail
+

Do not report coverage if test run fails.

+

Default: False

+
+
--no-cov
+

Disable coverage report.

+

Default: False

+
+
--cov-reset
+

Reset cov sources accumulated in options so far. Mostly useful for scripts and configuration files.

+

Default: False

+
+
--cov-fail-under
+

Fail if the total coverage is less than this value.

+
+
--cov-append
+

Do not delete coverage but append to current. Default: False.

+

Default: False

+
+
--cov-branch
+

Enable branch coverage.

+

Default: False

+
+
--cov-context
+

Coverage context to add to the coverage data.

+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/cli_reference/wallet.html b/cli_reference/wallet.html new file mode 100644 index 0000000..a266e26 --- /dev/null +++ b/cli_reference/wallet.html @@ -0,0 +1,446 @@ + + + + + wallet - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

wallet

+

Wallet management utilities.

+

+
usage: mox wallet [-h] [-d] [-q]
+                  {list,ls,generate,g,new,import,i,add,view,decrypt,dk,delete,d} ...
+
+
+
+

Positional Arguments

+
+
wallet_command
+

Possible choices: list, ls, generate, g, new, import, i, add, view, decrypt, dk, delete, d

+
+
+
+
+

Named Arguments

+
+
-d, --debug
+

Run in debug mode

+

Default: False

+
+
-q, --quiet
+

Suppress all output except errors

+

Default: False

+
+
+
+
+

Sub-commands

+
+

list (ls)

+

List all the accounts in the keystore default directory

+
mox wallet list [-h]
+
+
+
+
+

generate (g, new)

+

Create a new account with a random private key

+
mox wallet generate [-h] [--save] [--password PASSWORD |
+                    --password-file PASSWORD_FILE]
+                    name
+
+
+
+

Positional Arguments

+
+
name
+

Name of account

+
+
+
+
+

Named Arguments

+
+
--save
+

Save to keystore

+

Default: False

+
+
--password
+

Password for the keystore

+
+
--password-file
+

File containing the password for the keystore

+
+
+
+
+
+

import (i, add)

+

Import a private key into an encrypted keystore

+
mox wallet import [-h] name
+
+
+
+

Positional Arguments

+
+
name
+

Name of account to import

+
+
+
+
+
+

view

+

View the JSON of a keystore file

+
mox wallet view [-h] keystore_file_name
+
+
+
+

Positional Arguments

+
+
keystore_file_name
+

Name of keystore file

+
+
+
+
+
+

decrypt (dk)

+

Decrypt a keystore file to get the private key

+
mox wallet decrypt [-h] [--password PASSWORD |
+                   --password-file-path PASSWORD_FILE_PATH] [--print-key]
+                   keystore_file_name
+
+
+
+

Positional Arguments

+
+
keystore_file_name
+

Name of the keystore file to decrypt

+
+
+
+
+

Named Arguments

+
+
--password
+

Password for the keystore account.

+
+
--password-file-path
+

Path to the file containing the password for the keystore account.

+
+
--print-key, -p
+

Print the private key to the console

+

Default: False

+
+
+
+
+
+

delete (d)

+

Delete a keystore file

+
mox wallet delete [-h] keystore_file_name
+
+
+
+

Positional Arguments

+
+
keystore_file_name
+

Name of keystore file

+
+
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/common_errors.html b/common_errors.html new file mode 100644 index 0000000..7467243 --- /dev/null +++ b/common_errors.html @@ -0,0 +1,265 @@ + + + + + Common Errors - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Common Errors

+
+

ValueError: <boa.network.NetworkEnv object at 0xXXXXXXXXX>.eoa not defined!

+

This is the most common error you’ll run into, and it means you’ll need to add an account to your moccasin.toml. You can do this by following the wallet guide.

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/dependencies.html b/core_concepts/dependencies.html new file mode 100644 index 0000000..bc2a449 --- /dev/null +++ b/core_concepts/dependencies.html @@ -0,0 +1,375 @@ + + + + + Dependencies - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Dependencies

+

For working with smart contracts, moccasin allows for working with either:

+ +

Importantly, the packages/dependencies that you install are smart contract dependencies only. Meaning that they are dependencies for your vyper contracts, not for your python scripts.

+

To see working with python dependencies, go to Python packages in your scripts.

+
+

Installing GitHub Dependencies

+

To install a package from GitHub, you can run the following:

+
mox install ORG/REPO[@VERSION]
+
+
+

For example:

+
# Without a version
+mox install pcaversaccio/snekmate
+# With a version
+mox install pcaversaccio/snekmate@0.1.0
+
+
+

This will create an entry in your moccasin.toml file that looks like this:

+
[project]
+dependencies = [
+    "pcaversaccio/snekmate@0.1.0",
+]
+
+
+

Which follows the same syntax that pip and uv to do installs from GitHub repositories. This will also download the GitHub repository into your lib folder.

+

You can then use these packages in your vyper contracts, for example in an miniaml ERC20 vyper contract:

+
from pcaversaccio.snekmate.src.snekmate.auth import ownable as ow
+initializes: ow
+
+from pcaversaccio.snekmate.src.snekmate.tokens import erc20
+initializes: erc20[ownable := ow]
+exports: erc20.__interface__
+
+@deploy
+@payable
+def __init__():
+    erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02")
+    ow.__init__()
+
+
+

moccasin is smart enough to know that the lib/github and lib/pypi folders are part of the search path, but you can also explicitly add your dependencies.

+
# This is the "true" search path
+from lib.github.pcaversaccio.snekmate.src.snekmate.auth import ownable as ow
+initializes: ow
+
+from lib.github.pcaversaccio.snekmate.src.snekmate.tokens import erc20
+initializes: erc20[ownable := ow]
+exports: erc20.__interface__
+
+@deploy
+@payable
+def __init__():
+    erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02")
+    ow.__init__()
+
+
+
+
+

Installing uv/pip/PyPI Dependencies

+

Moccasin let’s you directly install and work with PyPI packages as you would any other python package. PyPi dependencies in moccasin are by default powered by the uv tool under the hood. It comes built-in with moccasin.

+

To install a package from PyPI, you can run the following:

+
mox install PACKAGE
+
+
+

For example:

+
mox install snekmate
+
+
+
+

Note

+

Snekmate is both a pypi and a GitHub package.

+
+

This will create an entry in your moccasin.toml file that looks like this:

+
[project]
+dependencies = [
+    "snekmate==0.1.0",
+]
+
+
+

You can then use these packages in your vyper contracts, for example in an miniaml ERC20 vyper contract:

+
# Vyper will directly inject the package into your contract
+from snekmate.auth import ownable as ow
+initializes: ow
+
+from snekmate.tokens import erc20
+initializes: erc20[ownable := ow]
+exports: erc20.__interface__
+
+@deploy
+@payable
+def __init__():
+    erc20.__init__("my_token", "MT", 18, "my_token_dapp", "0x02")
+    ow.__init__()
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/dependencies/purging.html b/core_concepts/dependencies/purging.html new file mode 100644 index 0000000..dd34ee0 --- /dev/null +++ b/core_concepts/dependencies/purging.html @@ -0,0 +1,304 @@ + + + + + Removing Dependencies (Purge) - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Removing Dependencies (Purge)

+

To remove a dependency from both:

+
    +
  • Your project (your lib folder)

  • +
  • Your moccasin.toml file

  • +
+

You can use the purge command.

+
+

Removing a pypi/pip dependency

+

To remove a pypi/pip dependency, you can run the following:

+
mox purge PACKAGE_NAME
+
+
+

And it will be removed from your:

+
    +
  • lib folder

  • +
  • moccasin.toml file

  • +
+
+
+

Removing a GitHub dependency

+

To remove a GitHub dependency, you can run the following:

+
mox purge ORG/REPO
+
+
+

And it will be removed from your:

+
    +
  • lib folder

  • +
  • moccasin.toml file

  • +
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/dependencies/virtual_environments.html b/core_concepts/dependencies/virtual_environments.html new file mode 100644 index 0000000..f16c7a3 --- /dev/null +++ b/core_concepts/dependencies/virtual_environments.html @@ -0,0 +1,337 @@ + + + + + Python packages in your scripts - moccasin documentation + + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Python packages in your scripts

+

When you want to add python packages to use in your scripts, it depends on how you installed moccasin.

+
+

In an isolated environment (uv tool install or pipx install)

+

If you installed moccasin with the uv tool install or pipx install, you can re-install your moccasin installation using the --with flag to “inject” the python packages you want to use.

+
+
# This will reinstall moccasin with pandas
+uv tool install moccasin --with pandas
+
+
+
+
+
+

In a virtual environment (uv pip install, uv add, or pip install)

+

Let’s say you have setup a virtual environment:

+
+
uv init
+uv venv
+source .venv/bin/activate
+
+
+
+
+

Note

+

Remember, to deactivate run:

+
deactivate
+
+
+
+

You can install python packages as you’d expect:

+
+
uv add pandas
+
+
+
+
+

Note

+

If you installed moccasin with uv add moccasin you’ll only be able to use these packages with uv run mox. If you want to use the mox command in your virtual environment, you’ll need to install moccasin with uv pip install moccasin.

+
+

We highly recommend that you setup a virtual environment or injecting packages into your mox isolated environment for working with your python scripts. And our recommended method is with the uv tool.

+
+
+ +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/core_concepts/deployments.html b/core_concepts/deployments.html new file mode 100644 index 0000000..261aa0d --- /dev/null +++ b/core_concepts/deployments.html @@ -0,0 +1,337 @@ + + + + + Deployments - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Deployments

+

In smart contract development, users often want to interact with contracts they’ve recently deployed, and keep track of them, so moccasin comes with a built-in sqlite3 database.

+

Any time you deploy a smart contract, so long as you have your save_to_db flag set to true in your config </api_reference/config_reference>, moccasin will automatically save your deployments to the database. Here is an example moccasin.toml file:

+
[networks.pyevm]
+save_to_db = false # Local and forked networks default to false
+
+[networks.anvil]
+save_to_db = true # Any other network default to true
+db_path = ".deployments.db"
+
+
+
+

Getting a deployment by contract name

+

You can then, get your latest deployment with any of the following options:

+
from moccasin.config import get_config
+from boa.contracts.abi.abi_contract import ABIContract
+# from boa.deployments import Deployment
+
+
+def moccasin_main():
+    config = get_config()
+    active_network = config.get_active_network()
+
+    # Get the latest counter of the Counter contract
+    counter_contract: ABIContract = active_network.get_latest_contract_unchecked("Counter")
+
+
+

This will get you a counter_contract object that you can interact with. It will look in the database and return the most recently deployed contract on the network that your script is active on. It’ll assign the ABI of your contract when you deployed it to the bytecode at that address.

+

There are a number of functions we can call to get either a ABIContract or Deployment object.

+
    +
  • get_deployments_unchecked: This will return all deployments for a given contract name, without checking checking integrity.

  • +
  • get_deployments_checked: This will return all deployments for a given contract name, checking checking integrity.

  • +
  • get_latest_deployment_checked: This will return the latest deployment for a given contract name, checking checking integrity.

  • +
  • get_latest_deployment_unchecked: This will return the latest deployment for a given contract name, without checking checking integrity.

  • +
  • get_latest_contract_checked: This will return the latest contract for a given contract name, checking checking integrity. It will convert the Deployment object to an ABIContract.

  • +
  • get_latest_contract_unchecked: This will return the latest contract for a given contract name, without checking checking integrity. It will convert the Deployment object to an ABIContract.

  • +
  • get_or_deploy_contract/ manifest_contract: This “magical” function will either check the database for a contract, deploy it, check your named contracts, and a few other places, and if it doesn’t find a contract, it will deploy the contract for you. You can read more about it here.

  • +
+
+
+

Checked vs Unchecked

+

When developing, you’ll often make changes to your smart contracts, and you may want to only interact with a contract that matches your current working contract. For example, I could have this code in a file called Counter.vy:

+
# SPDX-License-Identifier: MIT
+# pragma version 0.4.0
+number: public(uint256)
+@external
+def set_number(new_number: uint256):
+    self.number = new_number
+
+
+@external
+def increment():
+    self.number += 1
+
+
+

And deploy it as contract A, then, change it:

+
# SPDX-License-Identifier: MIT
+# pragma version 0.4.0
+number: public(uint256)
+@external
+def set_number(new_number: uint256):
+    self.number = new_number
+
+
+

And deploy it as contract B.

+

Now, when I call get_deployments_checked on Counter, it will only return 1 contract, contract B since that matches the contract that is in my current Counter.vy file.

+

But, if I call get_deployments_unchecked on Counter, it will return both contract A and contract B! Since that will only return deployments based on the contract_name (filename). The way this works, is that under the hood, moccasin does an integrity check by calling has_matching_integrity on the Network class, which compares a hash of each of the contract bytecodes to each other.

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/moccasin_toml.html b/core_concepts/moccasin_toml.html new file mode 100644 index 0000000..812e6bb --- /dev/null +++ b/core_concepts/moccasin_toml.html @@ -0,0 +1,353 @@ + + + + + moccasin.toml - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

moccasin.toml

+
+

Note

+

For an exhaustive list of options for your moccasin.toml file, see the all moccasin toml parameters documentation.

+
+

The moccasin.toml file created is our configuration file. In this file we can have:

+
    +
  • project and layout settings

  • +
  • network settings

  • +
  • dependencies settings

  • +
  • extra data

  • +
+

A moccasin.toml file can look like this:

+
[project]
+dependencies = ["snekmate==0.1.0"]
+src = "contracts"
+explorer_api_key = "${ETHERSCAN_API_KEY}"
+dot_env = ".env"
+
+[networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+chain_id = 11155111
+
+[extra_data]
+my_key = "other_data"
+
+
+

You can learn more about each of the sections of the moccasin.toml file in their respective documentation.

+ +

You can also see a full example of a moccasin.toml in the all moccasin toml parameters documentation.

+
+

Extra Data

+

Extra data is a dictionary of data where you can put whatever you’d like. You can access it from your scripts with:

+
from moccasin import config
+print(config.get_config().extra_data["my_key"])
+
+
+
+
+

pyproject.toml

+

If you like, you don’t even need to use a moccasin.toml, and instead you can just use a normal pyproject.toml file.

+
+

Important

+

If you have a moccasin.toml file, that file will have precedence over the pyproject.toml file. So if you have a parameter defined in both files, the value in the moccasin.toml file will be used.

+
+

An example pyproject.toml with a moccasin section would look like this:

+
# unrelated to your moccasin project, aka, "normal" python project settings
+[project]
+name = "project-no-config"
+version = "0.1.0"
+description = "Add your description here"
+readme = "README.md"
+requires-python = ">=3.11, <=3.13"
+dependencies = []
+
+# moccasin project settings
+[tool.moccasin.project]
+src = "contracts"
+dot_env = ".hello"
+
+[tool.moccasin.networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+
+
+

You have all the same options as you would in a moccasin.toml file, you’ll just need to prepend each with [tool.moccasin].

+
+
+

Order Of Operations

+

Whenever you run a script, you’ll want to remember this order:

+
    +
  1. Script

  2. +
  3. Command Line

  4. +
  5. moccasin.toml

  6. +
  7. pyproject.toml

  8. +
  9. Defaults

  10. +
+

Whatever you place in your python script, will be the value used, even if your command line has a different value. Similarly, any flag passed to the command line will override any values in your moccasin.toml, which will override any values in pyproject.toml, which will override default values moccasin sets.

+

This allows you to set your config file up, but if you want to make a tweak you don’t have to touch your source code, you can just adjust it on the fly!

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/named_contracts.html b/core_concepts/named_contracts.html new file mode 100644 index 0000000..add6584 --- /dev/null +++ b/core_concepts/named_contracts.html @@ -0,0 +1,387 @@ + + + + + Named Contracts - moccasin documentation + + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Named Contracts

+

One of the major differentiators between moccasin and other smart contract development tools is more flexible and powerful scripting. One of the such cabailities is built in fixtures and named contracts.

+

Named contracts allow you to define deployment scripts, addresses by chain, fixtures settings for testing, and more.

+
+

Named Contract Example - Minimal Example

+

Let’s look at a minimal moccasin.toml with a ETH mainnet network fork with a named contract:

+
[project]
+src = "contracts"
+
+[networks.mainnet-fork]
+url = "https://ethereum-rpc.publicnode.com"
+chain_id = 1
+fork = true
+
+# Look here! We have a named contract named "usdc"
+[networks.mainnet-fork.contracts]
+usdc = { address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}
+
+
+

The NamedContract in this case, is usdc. And it’s this named contract that we can access our scripts!

+
from moccasin.config import get_config
+
+def print_contract_address():
+    active_network = get_config().get_active_network()
+    named_contract = active_network.get_named_contract("usdc")
+    print(named_contract.address)
+
+def moccasin_main():
+    print_contract_address()
+
+
+

We could run this script, and it would, print out the address from our config.

+
mox run print_contract_address --network mainnet-fork
+
+0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
+
+
+
+
+

Named Contract Example - Interacting with the contract

+

Now, just getting the address is pretty boring, typically you want to interact with the contract. To do so, we have a number of parameters you can set in the config to get the contract ABI (Application Binary Interface).

+
+

Note

+

You can learn more about what an ABI is from Cyfrin Updraft or the Cyfrin Blog.

+
+

There are a number of flags we can set for our NamedContract:

+
+
[networks.mainnet-fork.contracts.usdc]
+address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
+abi = "ERC20.vy"
+abi_from_explorer = true
+fixture = false
+deployment_script = "script/deploy_erc20.py"
+force_deploy = false
+
+
+
+

Let’s break these down:

+
    +
  • address: The address of the contract on the network.

  • +
  • +
    abi`: The ABI source of the contract. This is can be any of the following:
      +
    • .json file path to an ABI file

    • +
    • .vy file path to a Vyper contract

    • +
    • Coming soon .vyi file path to a Vyper interface

    • +
    • A “raw” ABI string

    • +
    +
    +
    +
  • +
  • abi_from_explorer: If you want to get the ABI from an explorer. This is useful if you don’t have the ABI and you want to get it from a public source. You’ll need to set a explorer_api_key in your moccasin.toml, or an EXPLORER_API_KEY environment variable.

  • +
  • fixture`: If you want to use this contract as a fixture.

  • +
  • deployment_script: The path to the deployment script for this named contract, this will be a shorthand for deploying in the future.

  • +
  • force_deploy`: If you want to force deploy the contract when manifesting the contract.

  • +
+

As we know, to interact with a contract, one of the most important things is the ABI. For us to interact with any named contract, we give it an ABI, and we can start interacting with that named contract using the manifest_contract function.

+
from moccasin.config import get_config
+
+def print_contract_address():
+    active_network = get_config().get_active_network()
+    usdc: VyperContract = active_network.manifest_contract("usdc")
+    decimals = usdc.decimals()
+    print(decimals)
+
+def moccasin_main():
+    print_contract_address()
+
+
+

And running this on mainnet-fork will get the resulting output:

+

The key here, was the mainifest_contract, which does a lot of things under the hood, including:

+
    +
  • Deploys a contract if one doesn’t exist

  • +
  • Allows us to get fixtures for testing

  • +
  • Returns the named contract at it’s address if it’s on a chain we recognize

  • +
  • Sets up local testing environments for us to test our contracts

  • +
+

And more! Let’s read more about the power of NamedContracts and how they can help you in your development process.

+ +
+
+ +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/core_concepts/named_contracts/manifest_contract.html b/core_concepts/named_contracts/manifest_contract.html new file mode 100644 index 0000000..b8edb1b --- /dev/null +++ b/core_concepts/named_contracts/manifest_contract.html @@ -0,0 +1,386 @@ + + + + + Manifest Contract (get_or_deploy_contract) - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Manifest Contract (get_or_deploy_contract)

+
+

Note

+

Be sure to at least read manifest introduction before continuing here.

+
+

An issue that developers run into when creating smart contracts, is knowing how to make their deployment and scripting pipelines portable and flexible.

+
    +
  • What happens if you change chains that you want to deploy to?

  • +
  • How can you test to make sure your deploy scripts work exactly the way your tests run?

  • +
  • If I want to simulate a test with a forked test <forked-networks.rst>, will my scripts still work?

  • +
+

This is where the manifest_contract aka get_or_deploy_contract function comes in. Let’s say you have a smart contract that has an address as a constructor parameter, because the address is different on different chains. This additionally is very helpful in testing, and NamedContracts have built-in pytest fixtures.

+
+

Interacting with a contract on multiple networks with one script

+

Let’s take the following contract:

+
# pragma version 0.4.0
+# SPDX-License-Identifier: MIT
+from interfaces import ERC20
+
+usdc: public(ERC20)
+
+@deploy
+def __init__(usdc: address):
+    self.usdc = ERC20(usdc)
+
+@external
+def get_usdc_decimals() -> uint256:
+    return self.usdc.decimals()
+
+
+

We want to be able to test this contract on:

+
    +
  • A locally running network

  • +
  • A forked network

  • +
  • A testnet

  • +
  • A mainnet

  • +
  • Potentially a second mainnet

  • +
+

In order for us to do this traditionally, we’d have to write a separate script for every single one of these cases. For example:

+
if network.name == "locally_running_chain":
+    # do something...
+elif network.name == "forked_chain":
+    # do something...
+elif network.name == "testnet":
+    # do something...
+elif network.name == "mainnet":
+    # do something...
+elif network.name == "second_mainnet":
+    # do something...
+
+
+

And this is awful! So instead, what we can do, is setup ALL of the configuration in our moccasin.toml file and use the magic manifest_contract function to automatically deploy the contract on the correct network, with the correct parameters. Let’s look at the moccasin.toml file:

+
# At the top, we can set some default parameters for the `usdc` named contract
+# Every named contract will use the ERC20.vy contract in the project as it's ABI
+# If the contract doesn't exist, it'll deploy with the `deploy_feed.py` script (for example, on a locally running network)
+[networks.contracts]
+usdc = { abi = "ERC20", deployer_script = "mock_deployer/deploy_feed.py"}
+
+# We can then set the parameters for each network
+[networks.mainnet]
+url = "mainnet_url" # Enter your mainnet url here
+
+[networks.mainnet.contracts]
+usdc = { address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }
+
+[networks.sepolia]
+url = "sepolia_url" # Enter your mainnet url here
+
+[networks.sepolia.contracts]
+usdc = { address = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238" }
+
+[networks.arbitrum]
+url = "arbitrum" # Enter your mainnet url here
+
+[networks.arbitrum.contracts]
+usdc = { address = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" }
+
+
+

And with this, we only need ONE script that works for all of these!

+
from moccasin.config import get_config
+
+def get_decimals():
+    active_network = get_config().get_active_network()
+    usdc: VyperContract = active_network.manifest_contract("usdc")
+    decimals = usdc.decimals()
+    print(decimals)
+
+
+def moccasin_main():
+    get_decimals()
+
+
+

Then, we just need to adjust the –network flag and everything else will work automatically.

+
# Mainnet
+mox run get_decimals --network mainnet
+# Sepolia
+mox run get_decimals --network sepolia
+# Arbitrum
+mox run get_decimals --network arbitrum
+
+# These next two are special
+
+# Forked
+mox run get_decimals --network mainnet --fork
+# Local (pyevm)
+mox run get_decimals
+
+
+

The first 3 commands will do as you expect, directly connecting to the URL you set in your moccasin.toml file. The last two are special:

+
    +
  • The --fork flag will setup your script to run locally, using your mainnet url.

  • +
  • If you don’t specify a network, you’ll use the special locally running pyevm network.

  • +
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/networks.html b/core_concepts/networks.html new file mode 100644 index 0000000..1fd4eca --- /dev/null +++ b/core_concepts/networks.html @@ -0,0 +1,309 @@ + + + + + Networks - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Networks

+

Networks in moccasin are identified in your moccasin.toml. The complete list of options you can set for your network can be identified in the example here:

+
[networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+chain_id = 11155111
+is_fork = false
+is_zksync = false
+default_account_name = "anvil"
+unsafe_password_file = "~/.moccasin/password"
+extra_data = { "some_data" = "{$SOME_ENVIRONMENT_VARIABLE}" }
+save_to_db = true
+db_path = ".deployments.db"
+
+
+

Let’s walk through some of the options here.

+
+

Note

+

You can see a full list of options in the all moccasin toml parameters page.

+
+
    +
  • url: The URL of the network you are connecting to.

  • +
  • chain_id: The chain ID of the network you are connecting to.

  • +
  • is_fork: If you are forking a network, set this to true.

  • +
  • is_zksync: If you are connecting to a zkSync network, set this to true.

  • +
  • default_account_name: The default account name to use when deploying contracts. This will be the name of your account you created with your wallet command.

  • +
  • unsafe_password_file: The location of the password file for your account. This is a file that contains the password for your account. BE SURE TO NEVER PUSH THIS PASSWORD TO GITHUB IF YOU USE THIS.

  • +
  • extra-data: This is a dictionary of extra data you can use in your contracts.

  • +
  • save_to_db: If you want to save your deployments to a database.

  • +
  • db_path: The database path of your deployments.

  • +
+

You’ll notice there is no private-key. We highly discourage having private keys in plain text.

+

When working with a network from the command line, for example to run a script you can pass the --network flag via the command line, and it will load the data from the network in your moccasin.toml.

+

For example, if you wanted to run a script on the sepolia network, you would run:

+
moccasin run my_script --network sepolia
+
+
+

Since in our example we passed both a default_account_name and a unsafe_password_file, moccasin will automatically unlock the account for you. If you don’t pass a default_account_name or a unsafe_password_file, moccasin will error saying it cannot find your account.

+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/networks/eravm.html b/core_concepts/networks/eravm.html new file mode 100644 index 0000000..7a72ffb --- /dev/null +++ b/core_concepts/networks/eravm.html @@ -0,0 +1,290 @@ + + + + + eravm - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

eravm

+

The ZKsync era network comes with built-in support in moccasin.

+

This is a built-in network that comes with titanoboa-zksync. In order to get setup with working with eravm, be sure to follow the Getting started with ZKsync.

+

The eravm is one of the two “local” network environments (along with pyevm).

+
+

Running eravm

+

When you run a script with --network eravm, you’ll spin up a local instance of the ZKsync era network.

+
+
+

eravm network defaults

+
is_zksync = true
+prompt_live = false
+save_to_db = false
+live_or_staging = false
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/networks/forked_networks.html b/core_concepts/networks/forked_networks.html new file mode 100644 index 0000000..11254a7 --- /dev/null +++ b/core_concepts/networks/forked_networks.html @@ -0,0 +1,312 @@ + + + + + Forked Networks - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Forked Networks

+
+

What is Forking

+

Forking is the process of creating a local copy of a network at a specific block height. There is a bit of “magic” to it, because we don’t really download the whole blockchain locally, but as long as you have a connection to a node (like for example, via an RPC) you can fork a network.

+

It’s incredibly helpful for testing, because it allows you to simulate what could/would happen on a live network when you run a script or send a transaction.

+
+

Note

+

However, you don’t want to blindly trust simulations or the outcome of forked tests. In the real world, people can send transactions to the network while your script is in flight and mess with your scripting!

+
+
+
+

Forking

+

In testing, forking is an essential part of the development process. Any script that you want to run on a live network you should be running on a forked network first! In moccasin, forking is a first class citizen.

+
[networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+chain_id = 11155111
+is_fork = true
+
+
+

Running a script with this setup will run your script locally, but pretending to be on the sepolia network, with contracts and everything!

+

It essentially does some “lazy loading”, where it’ll only download information from the blockchain if/when you need. For example, if you want to get the balance of an account, it’ll only download the balance of that account when your script calls for it.

+

You can also take any non-forked network and run a forked test just by adding the –fork flag to the command line.

+
[networks.sepolia]
+url = "https://ethereum-sepolia-rpc.publicnode.com"
+chain_id = 11155111
+is_fork = false
+
+
+
+
+

Forked network defaults

+
is_zksync = false
+prompt_live = false
+save_to_db = false
+live_or_staging = false
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/networks/pyevm.html b/core_concepts/networks/pyevm.html new file mode 100644 index 0000000..05d67c3 --- /dev/null +++ b/core_concepts/networks/pyevm.html @@ -0,0 +1,305 @@ + + + + + pyevm - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

pyevm

+

If you don’t specify a network in your command line, by default, moccasin will use a special network called pyevm.

+

This is a built-in network that comes with titanoboa, and can be considered the core engine of the whole moccasin project.

+

So, when you originally mox init a project, you get a deploy script that looks like this:

+
from contracts import Counter
+from moccasin.boa_tools import VyperContract
+
+def deploy() -> VyperContract:
+    counter: VyperContract = Counter.deploy()
+    print("Starting count: ", counter.number())
+    counter.increment()
+    print("Ending count: ", counter.number())
+    return counter
+
+
+def moccasin_main() -> VyperContract:
+    return deploy()
+
+
+

We can run this script by running:

+
mox run deploy
+
+
+

You’ll notice, we didn’t add any network flags. This means that moccasin will simulate a minimal locally running network with the pyevm network. This network lasts only for the duration of your script, so if you want to save any output, you’ll have to do that yourself!

+
+

pyevm network defaults

+
is_zksync = false
+prompt_live = false
+save_to_db = false
+live_or_staging = false
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/project.html b/core_concepts/project.html new file mode 100644 index 0000000..80a610d --- /dev/null +++ b/core_concepts/project.html @@ -0,0 +1,307 @@ + + + + + Project Layout - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Project Layout

+

A typical moccasin project is structured as follows:

+
.
+├── README.md
+├── moccasin.toml
+├── script/
+├── src/
+├── tests/
+└── out/
+
+
+

Where:

+
    +
  • README.md is a markdown file that you can use to describe your project.

  • +
  • moccasin.toml is a configuration file that moccasin uses to manage the project.

  • +
  • script is a directory that contains python scripts that you can use to deploy your project.

  • +
  • src` is a directory that contains your vyper smart contracts.

  • +
  • tests is a directory that contains your tests.

  • +
  • out` is an optional directory that contains the compiled contracts. In moccasin and titanoboa, contracts are compiled on the fly!

  • +
+
+

Changing your layout

+

If you wanted to adjust your contracts location, for example, have your smart contracts folder be named contracts instead of src, you’d update your moccasin.toml file to reflect this change:

+
[project]
+src = "contracts"
+
+
+
+
+

Vyper Compiler Options

+

By default, moccasin discourages passing compiler options in the moccasin.toml file or CLI. Instead, if you wish to use vyper CLI commands, you’ll just put them right in the pragma of the contract:

+
# pragma version 0.4.0
+# pragma enable-decimals
+
+some_value: public(decimal)
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/script.html b/core_concepts/script.html new file mode 100644 index 0000000..2bf7923 --- /dev/null +++ b/core_concepts/script.html @@ -0,0 +1,408 @@ + + + + + Scripting - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Scripting

+ +
+

Help command

+
 mox run --help
+usage: Moccasin CLI run [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL | --prompt-live [PROMPT_LIVE]]
+                        [--account ACCOUNT | --private-key PRIVATE_KEY] [--password PASSWORD | --password-file-path PASSWORD_FILE_PATH]
+                        script_name_or_path
+
+Runs a script with the project's context.
+
+positional arguments:
+script_name_or_path   Name of the script in the script folder, or the path to your script.
+
+options:
+-h, --help            show this help message and exit
+-d, --debug           Run in debug mode
+-q, --quiet           Suppress all output except errors
+--fork [FORK]
+--network NETWORK     Alias of the network (from the moccasin.toml).
+--url URL, --rpc URL  RPC URL to run the script on.
+--prompt-live [PROMPT_LIVE]
+                        Prompt the user to make sure they want to run this script.
+--account ACCOUNT     Keystore account you want to use.
+--private-key PRIVATE_KEY
+                        Private key you want to use to get an unlocked account.
+--password PASSWORD   Password for the keystore account.
+--password-file-path PASSWORD_FILE_PATH
+                        Path to the file containing the password for the keystore account.
+
+
+
+
+

Scripting with Moccasin

+

Scripts are ways to deploy and work with contracts. You can either reference them by path or by name. For example, if your directory looks like this:

+
.
+├── README.md
+├── moccasin.toml
+├── script
+   └── deploy.py
+├── src
+   └── Counter.vy
+└── tests
+    ├── conftest.py
+    └── test_counter.py
+
+
+

You can run the deploy.py script with either:

+
mox run deploy
+
+
+

or

+
mox run ./script/deploy.py
+
+
+
+
+

Importing from src

+

You can directly import contracts from the src folder into your scripts, and interact with them! Let’s say you have a Counter contract in your src folder:

+
from src import Counter
+
+def deploy():
+    counter = Counter.deploy()
+    print("Starting count: ", counter.number())
+    counter.increment()
+    print("Ending count: ", counter.number())
+    return counter
+
+deploy()
+
+
+
+
+

Networking

+

If you have networks defined in your moccasin.toml, you can directly work with the network in your scripts. For example, if you have a sepolia network defined in your moccasin.toml:

+
mox run deploy --network sepolia
+
+
+

You can learn more about networks in the networks documentation.

+
+
+

moccasin_main

+

In your scripts, the moccasin_main function is special, if you have a function with this name in your script, moccasin will run this function by default after running the script like a regular python file. For example, you could also do this:

+
from src import Counter
+
+def deploy():
+    counter = Counter.deploy()
+    print("Starting count: ", counter.number())
+    counter.increment()
+    print("Ending count: ", counter.number())
+    return counter
+
+deploy()
+
+
+

And it would do the same as the following.

+
from src import Counter
+
+def deploy():
+    counter = Counter.deploy()
+    print("Starting count: ", counter.number())
+    counter.increment()
+    print("Ending count: ", counter.number())
+    return counter
+
+def moccasin_main():
+    deploy()
+
+
+

You can see a list of arguments in the moccasin reference documentation that you can run with your scripts.

+
+
+

Working with dependencies

+

There are two kinds of dependencies you can work with in your moccasin project:

+ +

Each have their own respective documentation.

+
+ +
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/scripting/console.html b/core_concepts/scripting/console.html new file mode 100644 index 0000000..40c4491 --- /dev/null +++ b/core_concepts/scripting/console.html @@ -0,0 +1,275 @@ + + + + + Console - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Console

+

You can enter a python shell with the console command. This will start a python shell with the moccasin module loaded, so you can interact with your contracts directly.

+
mox console
+
+
+

Press q and hit ENTER to exit the console.

+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/scripting/deploy.html b/core_concepts/scripting/deploy.html new file mode 100644 index 0000000..4cddf80 --- /dev/null +++ b/core_concepts/scripting/deploy.html @@ -0,0 +1,311 @@ + + + + + Deploy - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Deploy

+
mox deploy --help
+usage: Moccasin CLI deploy [-h] [-d] [-q] [--fork [FORK]] [--network NETWORK | --url URL | --prompt-live [PROMPT_LIVE]]
+                        [--account ACCOUNT | --private-key PRIVATE_KEY] [--password PASSWORD | --password-file-path PASSWORD_FILE_PATH]
+                        contract_name
+
+Deploys a contract named in the config with a deploy script.
+
+positional arguments:
+contract_name         Name of contract in your moccasin.toml to deploy.
+
+options:
+-h, --help            show this help message and exit
+-d, --debug           Run in debug mode
+-q, --quiet           Suppress all output except errors
+--fork [FORK]
+--network NETWORK     Alias of the network (from the moccasin.toml).
+--url URL, --rpc URL  RPC URL to run the script on.
+--prompt-live [PROMPT_LIVE]
+                        Prompt the user to make sure they want to run this script.
+--account ACCOUNT     Keystore account you want to use.
+--private-key PRIVATE_KEY
+                        Private key you want to use to get an unlocked account.
+--password PASSWORD   Password for the keystore account.
+--password-file-path PASSWORD_FILE_PATH
+                        Path to the file containing the password for the keystore account.
+
+
+

The deploy command is very similar to the run command, except it specifically works with NamedContracts that have a deployer_script defined.

+

In your moccasin.toml file, like this:

+
[networks.contracts]
+usdc = {  deployer_script = "script/deploy_usdc.py" }
+
+
+

You can directly deploy that script without using the run command, and instead:

+
mox deploy usdc
+
+
+

Which is essentially equivalent to running:

+
mox run script/deploy_usdc.py
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing.html b/core_concepts/testing.html new file mode 100644 index 0000000..3fecd0e --- /dev/null +++ b/core_concepts/testing.html @@ -0,0 +1,304 @@ + + + + + Testing - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Testing

+

moccasin uses pytest under the hood, so you can setup your tests like regular titanoboa based python tests.

+
def test_increment_one(counter_contract):
+    counter_contract.increment()
+    assert counter_contract.number() == 2
+
+
+def test_increment_two(counter_contract):
+    counter_contract.increment()
+    counter_contract.increment()
+    assert counter_contract.number() == 3
+
+
+

And run all your tests with mox test, to get an output like:

+
Running test command...
+====================================== test session starts =======================================
+platform darwin -- Python 3.11.6, pytest-8.3.3, pluggy-1.5.0
+rootdir: /Users/patrick/code/moccasin
+configfile: pyproject.toml
+plugins: cov-5.0.0, titanoboa-0.2.2, hypothesis-6.112.0
+collected 3 items
+
+tests/test_counter.py ..                                                                   [ 66%]
+tests/test_fork_usdc.py .                                                                  [100%]
+
+======================================= 3 passed in 0.01s ========================================
+
+
+

This is the most basic setup for testing.

+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/coverage.html b/core_concepts/testing/coverage.html new file mode 100644 index 0000000..ba583b8 --- /dev/null +++ b/core_concepts/testing/coverage.html @@ -0,0 +1,300 @@ + + + + + Coverage - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Coverage

+ +

You can also run coverage tests, using the --coverage flag, and any flag the comes with pytest-cov. This also uses titanoboa under the hood.

+

To run coverage tests, you can run:

+
mox test --coverage
+
+
+

And get an output like:

+
---------- coverage: platform darwin, python 3.11.6-final-0 ----------
+Name                                  Stmts   Miss Branch BrPart  Cover   Missing
+---------------------------------------------------------------------------------
+contracts/Counter.vy                      2      1      0      0    50%   9
+contracts/mocks/MockV3Aggregator.vy      16      8      0      0    50%   34-50
+script/__init__.py                        0      0      0      0   100%
+script/deploy.py                         10      1      0      0    90%   14
+script/deploy_coffee.py                  11      6      0      0    45%   7-11, 15
+script/get_usdc_balance.py                9      9      0      0     0%   1-14
+script/mock_deployer/deploy_feed.py       8      0      0      0   100%
+script/quad_manifest.py                  14     14      0      0     0%   1-24
+---------------------------------------------------------------------------------
+TOTAL                                    70     39      0      0    44%
+
+
+

You’ll notice the scripts are included by default, this is intentional. You can setup configuration for coverage in a .coveragerc file, or select a different configuration file by setting it in your moccasin.toml.

+
[project]
+cov_config = ".coveragerc"
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/fixtures.html b/core_concepts/testing/fixtures.html new file mode 100644 index 0000000..b96694c --- /dev/null +++ b/core_concepts/testing/fixtures.html @@ -0,0 +1,314 @@ + + + + + Fixtures - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Fixtures

+
+

What are fixtues?

+

Fixtures in pytest are functions that provide a fixed baseline or setup that your tests can use to operate in a controlled and predictable environment. They are used to define resources or state that will be used by the tests. Examples include setting up a database connection, creating a temporary file, initializing test data, or configuring environment variables.

+
+

Note

+

For more information on fixtures in pytest we recommend reading the pytest documentation or asking an AI chat bot.

+
+

One of the most powerful features of moccasin is the ability to define fixtures that can be used across multiple tests.

+
+
+

Using Fixtures

+

Fixtures are just NamedContracts with the fixture flag set to True.

+
[networks.contracts]
+price_feed = { deployer_script = "mock_deployer/deploy_feed.py", fixture = true }
+
+
+

If you setup a NamedContract as a fixture, you can request it in your tests. Ideally, you’d place this code in a conftest.py file in your tests directory.

+
request_fixtures(["price_feed"], scope="session")
+
+
+

This is roughly equivalent to doing:

+
from script.mock_deployer.deploy_feed import deploy_feed
+
+@pytest.fixture(scope="session")
+def price_feed():
+    return deploy_feed()
+
+
+

You can also renamed a named fixture, for example if you have multiple ERC20 contracts you want to give different names to:

+
# This will create 2 fixtures, on named "usdc" and one "dai" but they will both use the same erc20 deploy script or abi
+request_fixtures([ ("erc20", "usdc"), ("erc20", "dai")], scope="session")
+
+
+

Then, you can use these fixtures in your tests:

+
def test_using_fixtures(usdc, dai):
+    assert usdc.address is not None
+    assert dai.decimals() > 0
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/gas_profiling.html b/core_concepts/testing/gas_profiling.html new file mode 100644 index 0000000..dcac1c0 --- /dev/null +++ b/core_concepts/testing/gas_profiling.html @@ -0,0 +1,299 @@ + + + + + Gas Profiling - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Gas Profiling

+ +

moccasin has a built in gas profiler that can be used to profile your contracts gas usage. It uses titanoboa’s gas profiling under the hood.

+

To use the gas profiler, you can run:

+
mox test --gas-profile
+
+
+

And get an output like:

+
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━┳━━━━━┓
+ Contract     Address                                     Computation  Count  Mean  Median  Stdev  Min  Max ┃
+┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━╇━━━━━┩
+ FooContract  0x0000000000000000000000000000000000000066  foo          1      88    88      0      88   88  │
+└─────────────┴────────────────────────────────────────────┴─────────────┴───────┴──────┴────────┴───────┴─────┴─────┘
+
+
+┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
+ Contract                                              Computation                                                                 Count  Mean   Median  Stdev  Min    Max   ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━┩
+ Path:                                                                                                                                                                       │
+ Name: FooContract                                                                                                                                                           │
+ Address: 0x0000000000000000000000000000000000000066                                                                               Count  Mean   Median  Stdev  Min    Max   │
+ ----------------------------------------------------  --------------------------------------------------------------------------  -----  -----  -----   -----  -----  ----- │
+ Function: foo                                           4: def foo(a: uint256 = 0):                                               1      73     73      0      73     73    │
+                                                         5: x: uint256 = a                                                         1      15     15      0      15     15    │
+└──────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────┴───────┴───────┴────────┴───────┴───────┴───────┘
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/pranking.html b/core_concepts/testing/pranking.html new file mode 100644 index 0000000..9b51411 --- /dev/null +++ b/core_concepts/testing/pranking.html @@ -0,0 +1,278 @@ + + + + + Pranking - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Pranking

+

You can prank/impresonate/pretend to be other contracts or addresses in your test using the boa.prank function.

+
import boa
+print(boa.env.eoa) # 0x0000000000000000000000000000000000000065
+with boa.env.prank("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"):
+    print(boa.env.eoa) # 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
+
+
+

Using this pranking feature is the ideal way to impresonate addresses in tests.

+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/staging_markers.html b/core_concepts/testing/staging_markers.html new file mode 100644 index 0000000..777eb00 --- /dev/null +++ b/core_concepts/testing/staging_markers.html @@ -0,0 +1,342 @@ + + + + + Staging Markers - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Staging Markers

+

Have you ever wanted to run a test on a live network, but don’t want any of your other tests to run? Well, with moccasin you can!

+
+

The idea

+

A lot of developers should run some sanity checks on a live network, for example if you’re working with:

+
    +
  • Oracles

  • +
  • Setup tricks

  • +
  • etc

  • +
+

Maybe after you deploy your contracts, you want to run a quick test suite to make sure everything is ok, this is where “staging” tests come into play.

+
+
+

How to use staging markers

+
@pytest.mark.staging
+def test_staging_test(counter_contract):
+    counter_contract.increment()
+    assert counter_contract.number() == 2
+
+def test_normal_test(counter_contract):
+    counter_contract.increment()
+    assert counter_contract.number() == 2
+
+
+

The two tests above look the same, except for the staging marker. If we run our test suite normally:

+
mox test
+
+
+

Only the test_normal_test will run. But, let’s say we had a network named sepolia, if we run:

+
mox test --network sepolia
+
+
+

Then only the test_staging_test will run!

+
+
+

How it works

+

In your moccasin.toml file, you can assign a live_or_staging boolean:

+
[networks.sepolia]
+live_or_staging = true
+
+
+

If it’s set to true, then any test on this network will not run unless it has the staging marker.

+
+
+

Defaults

+
    +
  • Local networks (pyevm and eravm) have this defaulted to false.

  • +
  • Forked networks (set by --fork or fork = true in your config) have this defaulted to false.

  • +
  • All other networks have this defaulted to true.

  • +
+
+
+

What if I want my staging test to also run on my local networks?

+

To have a staging test also run on local and forked networks, you can do:

+
@pytest.mark.staging
+@pytest.mark.local # See this!
+def test_staging_test(counter_contract):
+    counter_contract.increment()
+    assert counter_contract.number() == 2
+
+def test_normal_test(counter_contract):
+    counter_contract.increment()
+    assert counter_contract.number() == 2
+
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/testing/titanoboa_testing.html b/core_concepts/testing/titanoboa_testing.html new file mode 100644 index 0000000..5590c96 --- /dev/null +++ b/core_concepts/testing/titanoboa_testing.html @@ -0,0 +1,276 @@ + + + + + Titanoboa Testing - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/core_concepts/wallet.html b/core_concepts/wallet.html new file mode 100644 index 0000000..c96d401 --- /dev/null +++ b/core_concepts/wallet.html @@ -0,0 +1,348 @@ + + + + + Wallet - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Wallet

+

By default, you don’t want to ever expose your private key in your scripts. You can use the wallet commands to manage your private keys and accounts.

+
mox wallet --help
+
+usage: Moccasin CLI wallet [-h] [-d] [-q] {list,ls,generate,g,new,import,i,add,view,decrypt,dk,delete,d} ...
+
+Wallet management utilities.
+
+positional arguments:
+{list,ls,generate,g,new,import,i,add,view,decrypt,dk,delete,d}
+    list (ls)           List all the accounts in the keystore default directory
+    generate (g, new)   Create a new account with a random private key
+    import (i, add)     Import a private key into an encrypted keystore
+    view                View the JSON of a keystore file
+    decrypt (dk)        Decrypt a keystore file to get the private key
+    delete (d)          Delete a keystore file
+
+options:
+-h, --help            show this help message and exit
+-d, --debug           Run in debug mode
+-q, --quiet           Suppress all output except errors
+
+
+
+

Encrypting a private key

+

You can encrypt a private key using the wallet import ACCOUNT_NAME command. This will create a keystore file in the default keystore directory. It will prompt you to enter your private key and password.

+
$ mox wallet import my_account
+
+Running wallet command...
+Importing private key...
+Enter your private key:  ...
+
+
+

Once you have an account, you can view it with the wallet list command.

+
$ mox wallet list
+
+Running wallet command...
+Found 1 accounts:
+my_account
+
+
+

This will encrypt your key and store it at ~/.moccasin/keystore/my_account.json. You can view the contents of the keystore file with the wallet inspect command.

+
$ mox wallet inspect my_account
+Running wallet command...
+Keystore JSON for account my_account:
+{
+    "address": "f39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
+    "crypto": {
+        "cipher": "aes-128-ctr",
+        "cipherparams": {
+            "iv": "e6966dcf6d5384f050052f71ed7bfc02"
+        },
+        "ciphertext": "decc1fbd482a171578028bfb2563362b9f4857765d6247900bde22e0cd6c2c13",
+        "kdf": "scrypt",
+        "kdfparams": {
+            "dklen": 32,
+            "n": 262144,
+            "r": 8,
+            "p": 1,
+            "salt": "71326ecf78c3a2f2087366e4516d44f1"
+        },
+        "mac": "62dbc22cce0e270a71a5ac1a8c57b04eafa215839abcbdb9f349d63b6b9e5e9f"
+    },
+    "id": "ea0a89c0-04ea-4120-b6a4-b55fbb0baade",
+    "version": 3
+}
+
+
+

You can then use these in scripts!

+
mox run deploy --account my_account
+
+
+

And it will ask you for the password to decrypt your private key.

+ +
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/wallet/config_keys.html b/core_concepts/wallet/config_keys.html new file mode 100644 index 0000000..d3ff727 --- /dev/null +++ b/core_concepts/wallet/config_keys.html @@ -0,0 +1,277 @@ + + + + + Configurating Keys - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Configurating Keys

+

The preferred method for working with keys, is encrypting them with the mox wallet command.

+
[networks.zksync]
+default_account_name = "anvil1"
+
+
+

Setting a default_account_name will make it so that when you run a deploy script, it will automatically attempt to use the keystore file imported as anvil1 (in this example). It will additionally prompt you for a password to decrypt your keystore file for the duration of the script.

+

You can also pass an --unsafe-password-file xxx flag or in your moccasin.toml with the location of a file that holds your password. It uses the unsafe prefix to alert you that you might not want to make the file’s location public!

+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/core_concepts/wallet/private_key.html b/core_concepts/wallet/private_key.html new file mode 100644 index 0000000..50eae27 --- /dev/null +++ b/core_concepts/wallet/private_key.html @@ -0,0 +1,274 @@ + + + + + Private Keys - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Private Keys

+

By default, moccasin discourages keeping your private keys in plain text, and it’s much better to encrypt them. However, if you insist, you may also pass private keys to your scripts via the command line.

+
mox run deploy --private-key 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/explorer_network_defaults.html b/explorer_network_defaults.html new file mode 100644 index 0000000..ef394d7 --- /dev/null +++ b/explorer_network_defaults.html @@ -0,0 +1,586 @@ + + + + + Explorer and Network Default Information - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Explorer and Network Default Information

+
[mainnet]
+explorer = "https://eth.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696"
+chain_id = 1
+
+[sepolia]
+explorer = "https://eth-sepolia.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 11155111
+
+[goerli]
+explorer = "https://eth-goerli.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696"
+chain_id = 5
+
+[arbitrum]
+explorer = "https://arbitrum.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0x5B5CFE992AdAC0C9D48E05854B2d91C73a003858"
+chain_id = 42161
+
+[optimism-main]
+explorer = "https://optimism.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0x2DC0E2aa608532Da689e89e237dF582B783E552C"
+chain_id = 10
+
+[optimism-test]
+explorer = "https://optimism-sepolia.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0x2DC0E2aa608532Da689e89e237dF582B783E552C"
+chain_id = 420
+
+[polygon-main]
+explorer = "https://polygon.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = "0xc8E51042792d7405184DfCa245F2d27B94D013b6"
+chain_id = 137
+
+[gnosis-main]
+explorer = "https://gnosis.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 100
+
+[gnosis-test]
+explorer = "https://gnosis-chiado.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 10200
+
+[base-main]
+explorer = "https://base.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 8453
+
+[syscoin]
+explorer = "https://explorer.syscoin.org/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 57
+
+[ethereumclassic]
+explorer = "https://etc.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 61
+
+[nova-network]
+explorer = "https://explorer.novanetwork.io/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 87
+
+[velas]
+explorer = "https://evmexplorer.velas.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 106
+
+[thundercore]
+explorer = "https://explorer-mainnet.thundercore.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 108
+
+[fuse]
+explorer = "https://explorer.fuse.io/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 122
+
+[heco]
+explorer = ""
+multicall2 = ""
+chain_id = 128
+
+[shimmer_evm]
+explorer = "https://explorer.evm.shimmer.network/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 148
+
+[manta]
+explorer = "https://pacific-explorer.manta.network/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 169
+
+[energyweb]
+explorer = "https://explorer.energyweb.org/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 246
+
+[oasys]
+explorer = "https://explorer.oasys.games/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 248
+
+[omax]
+explorer = "https://omaxscan.com/"
+multicall2 = ""
+chain_id = 311
+
+[filecoin]
+explorer = "https://filecoin.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 314
+
+[kucoin]
+explorer = "https://scan.kcc.io/"
+multicall2 = ""
+chain_id = 321
+
+[zksync-era]
+explorer = "https://zksync2-mainnet-explorer.zksync.io"
+explorer_type = "zksyncexplorer"
+multicall2 = ""
+chain_id = 324
+
+[sepolia-zksync-era]
+explorer = "https://explorer.sepolia.era.zksync.dev"
+explorer_type = "zksyncexplorer"
+multicall2 = ""
+chain_id = 300
+
+[shiden]
+explorer = "https://shiden.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 336
+
+[rollux]
+explorer = "https://explorer.rollux.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 570
+
+[astar]
+explorer = "https://astar.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 592
+
+[callisto]
+explorer = "https://explorer.callisto.network/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 820
+
+[lyra-chain]
+explorer = "https://explorer.lyra.finance/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 957
+
+[bifrost]
+explorer = "https://explorer.mainnet.bifrostnetwork.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 996
+
+[metis]
+explorer = "https://andromeda-explorer.metis.io/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1088
+
+[polygon-zkevm]
+explorer = "https://zkevm.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1101
+
+[core]
+explorer = ""
+multicall2 = ""
+chain_id = 1116
+
+[lisk]
+explorer = "https://blockscout.lisk.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1135
+
+[reya-network]
+explorer = "https://explorer.reya.network/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1729
+
+[onus]
+explorer = "https://explorer.onuschain.io/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1975
+
+[hubblenet]
+explorer = ""
+multicall2 = ""
+chain_id = 1992
+
+[sanko]
+explorer = "https://explorer.sanko.xyz/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1996
+
+[dogechain]
+explorer = "https://explorer.dogechain.dog/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 2000
+
+[milkomeda]
+explorer = "https://explorer-mainnet-cardano-evm.c1.milkomeda.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 2001
+
+[kava]
+explorer = "https://testnet.kavascan.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 2222
+
+[mantle]
+explorer = "https://explorer.mantle.xyz/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 5000
+
+[zetachain]
+explorer = "https://zetachain.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 7000
+
+[celo]
+explorer = "https://explorer.celo.org/mainnet/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 42220
+
+[oasis]
+explorer = "https://explorer.emerald.oasis.dev/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 42262
+
+[linea]
+explorer = "https://explorer.linea.build/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 59144
+
+[blast]
+explorer = "https://blast.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 81457
+
+[taiko]
+explorer = "https://blockscoutapi.mainnet.taiko.xyz/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 167000
+
+[scroll]
+explorer = "https://blockscout.scroll.io/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 534352
+
+[zora]
+explorer = "https://explorer.zora.energy/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 7777777
+
+[neon]
+explorer = "https://neon.blockscout.com/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 245022934
+
+[aurora]
+explorer = "https://explorer.mainnet.aurora.dev/"
+explorer_type = "blockscout"
+multicall2 = ""
+chain_id = 1313161554
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/genindex.html b/genindex.html new file mode 100644 index 0000000..2be0f24 --- /dev/null +++ b/genindex.html @@ -0,0 +1,542 @@ + + + + + Index - moccasin documentation + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | H + | I + | L + | M + | N + | O + | P + | R + | S + | T + | U + | V + | W + +
+

_

+ + +
+ +

A

+ + + +
+ +

B

+ + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + +
+ +

P

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + +
+ + + +
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/how-tos/verify_contracts.html b/how-tos/verify_contracts.html new file mode 100644 index 0000000..f15aa95 --- /dev/null +++ b/how-tos/verify_contracts.html @@ -0,0 +1,306 @@ + + + + + Contract Verification - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Contract Verification

+

The titanoboa tool comes with built in contract verification. To make life easier, we created a wrapper function called moccasin_verify that you can use to verify contracts.

+
+

1. Setup your explorer

+

In your moccasin.toml add your explorer details:

+
explorer_uri = "https://explorer.sepolia.era.zksync.dev"
+explorer_type = "zksyncexplorer"
+explorer_api_key = "None"
+
+
+

Some networks, like sepolia-zksync, have some of these details defaulted for you. You can check out the Explorer and Network Default Information page to see what’s available. As of today, the only supported explorers are:

+ +
+
+

2. Add moccasin_verify to your script

+

In your script, let say, named deploy_and_verify.py, you can run the following code:

+
def moccasin_main():
+    active_network = get_active_network()
+    counter = Counter.deploy()
+    print("Counter deployed at", counter.address)
+    result = active_network.moccasin_verify(counter)
+    result.wait_for_verification()
+    print("Counter verified")
+
+
+
+
+

3. Run your script

+
mox run deploy_and_verify.py --network my_network
+
+
+

That’s it!

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..d1bf028 --- /dev/null +++ b/index.html @@ -0,0 +1,398 @@ + + + + + Moccasin - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+ Moccasin logo + +
+

Moccasin

+

Moccasin is a fast, pythonic smart contract development framework heavily powered by titanoboa.

+
+

Note

+

This project is under active development.

+
+
usage: Moccasin CLI [-h] [-d] [-q]
+                {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util} ...
+
+🐍 Pythonic Smart Contract Development Framework
+
+positional arguments:
+{init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}
+    init                Initialize a new project.
+    compile (build)     Compiles the project.
+    test                Runs all tests in the project.
+    run (script)        Runs a script with the project's context.
+    deploy              Deploys a contract named in the config with a deploy script.
+    wallet              Wallet management utilities.
+    console             BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.
+    install             Installs the project's dependencies.
+    purge               Purge a given dependency
+    config              View the Moccasin configuration.
+    explorer            Work with block explorers to get data.
+    inspect             Inspect compiler data of a contract.
+    deployments         View deployments of the project from your DB.
+    utils (u, util)     Helpful utilities - right now it's just the one.
+
+options:
+-h, --help            show this help message and exit
+-d, --debug           Run in debug mode
+-q, --quiet           Suppress all output except errors
+
+
+
+

How to read the documentation

+

The moccasin documentation is written in a way that assumes you are on a MacOS or Linux-like system. If you are using windows, we recommend you watch the first 10 minutes of this WSL tutorial and work with WSL. WSL stands for “Windows Subsystem for Linux” and it allows you to run a Linux commands on Windows machine.

+
+

TOML Formatting

+

In TOML you can think of each section as a giant JSON object. Each of these are essentially identical:

+
+ + + + + + + + + + + + + +

TOML (Expanded)

TOML (Compact)

JSON

[project]
+src = "contracts"
+
+[project.networks.sepolia]
+url = "https://..."
+chain_id = 11155111
+
+[project.networks.zksync]
+url = "https://..."
+chain_id = 324
+
+
+
[project]
+src = "contracts"
+networks = {
+  sepolia = {
+    url = "https://...",
+    chain_id = 11155111
+  },
+  zksync = {
+    url = "https://...",
+    chain_id = 324
+  }
+}
+
+
+
{
+  "project": {
+    "src": "contracts",
+    "networks": {
+      "sepolia": {
+        "url": "https://...",
+        "chain_id": 11155111
+      },
+      "zksync": {
+        "url": "https://...",
+        "chain_id": 324
+      }
+    }
+  }
+}
+
+
+
+
+
+
+
+

Why Moccasin?

+

We think web3 needs the following:

+
    +
  1. +
    A python smart contract development framework.
      +
    1. We need this because python is the 2nd most popular language on earth, and is the number one choice for artificial intelligence and new computer engineers!

    2. +
    +
    +
    +
  2. +
  3. +
    An easy way to run devops on contracts.
      +
    1. Running scripts to interact with contracts needs to be easy in a language that humans can understand.

    2. +
    +
    +
    +
  4. +
  5. And finally… it needs to be fast!

  6. +
+

Then, we have some fun plans for AI, formal verification, fuzzing, and more in the future of moccasin, so stay tuned!

+

Head over to installing moccasin to get started.

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/installing_moccasin.html b/installing_moccasin.html new file mode 100644 index 0000000..3caf6b4 --- /dev/null +++ b/installing_moccasin.html @@ -0,0 +1,431 @@ + + + + + Installing Moccasin - moccasin documentation + + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Installing Moccasin

+
+

Note

+

Beginner Developers:

+

Are you a new or beginner python developer? Then follow these steps:

+
    +
  1. Install uv

  2. +
  3. Install moccasin in an isolated environment

  4. +
  5. Check to see if it worked

  6. +
  7. Go to the quickstart!

  8. +
+
+

There are a few things you’ll need on your machine before you can install Moccasin. Please install the appropriate tools from the Prerequisites section. Once you have those, the recommended way to install Moccasin is via uv.

+ +
+

Prerequisites

+
    +
  1. Python 3.11 or later

  2. +
+
+

Installation with uv

+

For those unfamiliar, uv is a fast python package manager that helps us install moccasin into it’s own isolated virtual environment, so we don’t get any weird dependency conflicts with other python packages. It’s similar to pip and pipx if you’ve used them before. It even comes with some pip compatibility, will tools like uv pip install.

+

It’s highly recommended you understand how virtual environments work as well.

+

The easiest way to install uv is:

+
+
curl -LsSf https://astral.sh/uv/install.sh | sh
+
+
+
+

But you can head over to the uv installation instructions for more options. If you don’t have at least Python 3.11 installed, you’ll need to install that first.

+
uv python install 3.11
+
+
+
+

Isolated Environment

+

To install moccasin into an isolated environment with uv, run:

+
uv tool install moccasin
+
+
+

If you wish to install moccasin and use other python packages in your scripts, you’ll use the with flag:

+
uv tool install moccasin --with pandas
+
+
+
+

Note

+

Installing moccasin into a virtual environment (via uv tools install or pipx install) will require a different setup for injecting python packages. See Python packages in your scripts for more information.

+
+

Then, go to after installation.

+
+
+

Virtual Environment

+

If instead, you’d prefer to have different mox executeables Or, if you want to have moccasin installed with a traditional virtual environment set, you can run:

+
uv init
+uv venv
+source .venv/bin/activate
+
+
+

Then, you can install it as a uv installation:

+
uv add moccasin
+
+
+

Where you’ll be able to run the executeable with uv run mox instead of mox (see after installation).

+

Or a pip installation:

+
uv pip install moccasin
+
+
+

Where you’ll be able to run the executeable with mox (see after installation).

+
+
+
+

Installation with pipx

+

Pipx is a tool to help you install and run end-user applications written in Python. It’s roughly similar to macOS’s brew, JavaScript’s npx, and Linux’s apt.

+

pipx installs Moccasin into a virtual environment and makes it available directly from the commandline. Once installed, you will never have to activate a virtual environment prior to using Moccasin.

+

pipx does not ship with Python. If you have not used it before you will probably need to install it.

+

You can either head over to the pipx installation instructions or follow along below.

+

To install pipx:

+
python -m pip install --user pipx
+python -m pipx ensurepath
+
+
+
+

Note

+

You may need to restart your terminal after installing pipx.

+
+

To install moccasin then with pipx:

+
pipx install moccasin
+
+
+
+

Note

+

Installing moccasin into a virtual environment (via uv tools install or pipx install) will require a different setup for injecting python packages. See Python packages in your scripts for more information.

+
+

Then, go to after installation.

+
+
+

Installation with pip

+

You can install with pip, and if you do so, it’s highly recommended you understand how virtual environments work.

+

To install with pip:

+
pip install moccasin
+
+
+

Then, go to after installation.

+
+
+

From source

+

To install from source, you’ll need the uv tool installed. Once installed, you can run:

+
git clone https://github.com/cyfrin/moccasin
+cd moccasin
+uv sync
+source .venv/bin/activate
+uv pip install -e .
+
+
+

And you will have mox in your virtual environment created from the uv tool. It’s highly recommended you understand how virtual environments work.

+

Then, go to after installation.

+
+
+
+

After installation

+

Once installed, to verify that Moccasin is installed, you can run:

+
mox --version
+
+
+

And see an output like:

+
Moccasin CLI v0.1.0
+
+
+
+
+ +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000000000000000000000000000000000000..1b9ceedba7ed549fd50b6a4b5ec835a09cfcf5c9 GIT binary patch literal 2365 zcmV-D3BvXxAX9K?X>NERX>N99Zgg*Qc_4OWa&u{KZXhxWBOp+6Z)#;@bUGkyZ)0O& zb7^i0BOq2~a&u{KZaN@MZ)0O&b7^iMLrh5^b}%k8E-?xtAXI2&AaZ4GVQFq;WpW^I zW*~HEX>%ZEX>4U6X>%ZBZ*6dLWpi_7WFU2OX>MmAdTeQ8E(&8^V=jNQbs>Uq-3$6J1S_A&<7*d6l@ME&)$3&tylRV(uO38ort3G zmJ@`{sXFk~BW}9&3A?RWmc~1trBonpDR@bRI=>#-DwISWyaOu%!yyAT`xGa&QTW46 z>5f#HiVLcqxi|&|j|-Ah-wY)!QV?ZSA~I1*ux+KN2WYNhTAcj0m%fywND((a5g~mp z8Tta|7pFuK&jYbz&|+uZK3lATVQl}QiHZg1UcvWN#d>q1ZQJ&Vz9ka2y_NyStdNRi zS-rXVWb5r)KB3cX7}(z0^oeb!)H^O0*zAm-gBUzA__p(mZG$+RjFZ$E-A?e_d&6@o z_S7;2%Ua256X?Ix9t?lpI9@~3%*#3hwL2Ik_ zYIAK|aA{OhaYEzHb6P0>Os=jK5{ALYMHCkO4x`l=RG{H%2!f1P7e4HO$waU+%swQ8 zMr2YXL0YZAn*;%V7EDq9LDJV|XorsuTr##CYeO4SY>wkS`34SXp`V|=GU)L+6)rb84Qk2K-@a3?I;A9cBpZ3 zpvjS@VM(eY7)?gB+p0(GZbaex)Y^ORNENVOXw7LLCvu4|{S#buW^yA3xLvkmuoIY= z#w-4T$k=Ve{*iN{k^?LDF)I|^L(F&f%fTRcRC;WD2Wa{<6ReV>` zZpIUmp=lxk*#CUSaT`xPz0>zHy;vWKR7$InT@c5S!dcVOz{ z1HCDDUQR(`R9KZcB-J?X-mxWt$s}7ACWP1MkmH!!UBA#So$Tt_2glIyb5mVV}e(LPrfL)4f~o*_gd(YyKdh+SKVvg zPBDKccsq8;cDv!aOzR5=*&A8vnuR7E<0BA#D6-Mcs|!63_p>E(^>6n zImu1|ntj9s8>t<&^Y{z?}~cvaJ6j8#`z{EIqDeC zY9_CqAQ?=-BOCXw=Hl8};C>7o)gkpt-$HaxlRI{rV7vs~PiU#+L+iH5SgTWCH|p>0 zy~asKf4EDIm5vgITimO%_JV~}M&Dd9ATa$tg%qjmsyF3U_wyszn=a|;x2-fU@wBA} zbRl36?Z*X%e)}^4q0<+OpzZ%cK=SEEXn`66KYAF}%Z);qdV^qo4+5BHKQk!Jyhp8q z9$pwz&CT-=kJI(D>K+#S*G zGtN=Oj+nu$gB&dCq4qD7M{#?CEgu{?CoHG2A1<$wma<){+K9sz*G-7NA3hH28%uo} zH{Jqw@YN0nE#2^Ng4?6p4(K>QAZhu60AOM(@Y%lR1 zD7u8nP0|V&h~Le}Fb4GD1je#q44f!(neRf#Dd(U-JFXun2a_XHo=^Bv2U z^uH@^2!19Kt;rOPu#|!n$3+BA(pjnb8iBR9?r~0Fp@{`U(^Ie(Z13*Bn8Fb*#S|$x z9vd$;mP-|DKCXDgkOqR0fqH}WmkUNN1zbLgXTNh`ZP|9(S_z`N`U%R1N!n-Hb0jTU zH@&*Rz}L?=T~1gZ__T0Gg$&?F7lLC3bW=W8YQP@x z=jy30<$`;TJn1+sqcZ1_M4c6LVtvgt)VfvY=U#e|4 znjUC*ccO+nHZ}Sv4CCgfO8_+5pX&4g)eleSr^jBWz?TyIXTHVradW3f%B>E427?6och|RccWQY$|Nr#YFI<>6vZO!o;DVBppnC>8{u~3Wi1#9X~8zH z2x@bl4s0UjdF?9PYECQYh}lkBwKHlq-|1-oTe0K_(o86I69y}aCrZ#xuw#pQTbZg97mQ@`!92xV!>Hndg#)&?G? jFmeFeHvayE3ail!bisNX&q3eVnso + + + + Quickstart - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Quickstart

+
+

Creating a new project

+

To create a new project, you can run the following command:

+
mox init my_project
+
+
+

And this will create a new project in a new my_project directory. If you want to create a project in a directory that already has files/folders in it, run:

+
mox init my_project --force
+
+
+

If you use VSCode, you can also use:

+
mox init my_project --vscode
+
+
+

Which will create a .vscode folder to help make working with VSCode easier.

+

Let’s check out the files and folders moccasin has created:

+
+

Note

+

MacOS users may need to install tree with brew install tree. You can of course, just not install tree and skip this tree command.

+
+

Run the following commands:

+
cd my_project
+tree .
+
+
+

You’ll get an output like:

+
.
+├── README.md
+├── moccasin.toml
+├── script
+│   ├── __init__.py
+│   └── deploy.py
+├── src
+│   └── Counter.vy
+└── tests
+    ├── conftest.py
+    └── test_counter.py
+
+
+

This is a minimal project structure that moccasin creates.

+
    +
  • README.md is a markdown file that you can use to describe your project.

  • +
  • moccasin.toml is a configuration file that moccasin uses to manage the project.

  • +
  • script is a directory that contains scripts that you can use to deploy your project.

  • +
  • src is a directory that contains your vyper smart contracts.

  • +
  • tests` is a directory that contains your tests.

  • +
+

If you run tree . -a, you’ll also see the “hidden” files.

+
    +
  • .gitignore is a file that tells git which files to ignore.

  • +
  • .gitattributes is a file that tells git how to handle line endings.

  • +
  • .coveragerc is a file that tells pytest how to handle coverage.

  • +
+
+
+

Deploying a contract

+

Now, unlike other frameworks, with moccasin, we never need to compile! Moccasin uses titanoboa under the hood to compile contracts quickly on the fly. Let’s open our deploy.py file and look inside.

+
from src import Counter
+
+def deploy():
+    counter = Counter.deploy()
+    print("Starting count: ", counter.number())
+    counter.increment()
+    print("Ending count: ", counter.number())
+    return counter
+
+def moccasin_main():
+    return deploy()
+
+
+

We can see a python script that will:

+
    +
  1. Deploy our Counter contract.

  2. +
  3. Print the starting count inside the contract.

  4. +
  5. Increment the count.

  6. +
  7. Print the ending count inside the contract.

  8. +
+

We can run this script to the titanoboa pyevm (a local network that simulates ethereum) by running:

+
mox run deploy
+
+
+

And we’ll get an output like:

+
Running run command...
+Starting count:  0
+Ending count:  1
+
+
+

Awesome! This is how easy it is to run scripts with your smart contracts.

+
+
+

Running tests

+

Under the hood, moccasin uses pytest, and you can use a lot of your favorite pytest command line commands. If you just run:

+
mox test
+
+
+

You’ll get an output like:

+
Running test command...
+=================================== test session starts ===================================
+platform darwin -- Python 3.11.9, pytest-8.3.2, pluggy-1.5.0
+rootdir: /your/path/my_project
+plugins: cov-5.0.0, hypothesis-6.108.5, titanoboa-0.2.1
+collected 1 item
+
+tests/test_counter.py .                                                             [100%]
+
+==================================== 1 passed in 0.01s ====================================
+
+
+
+

Note

+

If you want to add python dependencies to your moccasin project, see: virtual environments documentation.

+
+

But that’s it! You’ve now successfully gotten your first package up and going!

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 0000000..ce2d7ab --- /dev/null +++ b/search.html @@ -0,0 +1,125 @@ + + + + + Search - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ + +
+
+
+
+
+
+
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + +
+

+ + +
+ + +
+ +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 0000000..33d3cb3 --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles": {"1. Setup your explorer": [[48, "setup-your-explorer"]], "1. Setup your network": [[53, "setup-your-network"]], "2. Add moccasin_verify to your script": [[48, "add-moccasin-verify-to-your-script"]], "3. Run your script": [[48, "run-your-script"]], "After installation": [[50, "after-installation"]], "All moccasin toml parameters": [[0, null]], "All possible options": [[0, "all-possible-options"]], "CLI Command Reference": [[7, null]], "Changing your layout": [[33, "changing-your-layout"]], "Checked vs Unchecked": [[25, "checked-vs-unchecked"]], "Classes Reference": [[6, null]], "Common Errors": [[21, null]], "Config": [[1, null]], "Configurating Keys": [[45, null]], "Console": [[35, null]], "Contract Verification": [[48, null]], "Core Concepts": [[52, null]], "Coverage": [[38, null]], "Creating a new project": [[51, "creating-a-new-project"]], "Defaults": [[42, "defaults"]], "Dependencies": [[22, null]], "Deploy": [[36, null]], "Deploying a contract": [[51, "deploying-a-contract"]], "Deployment": [[53, "deployment"]], "Deployments": [[25, null]], "Encrypting a private key": [[44, "encrypting-a-private-key"]], "Environment Variables": [[0, "environment-variables"]], "Explorer and Network Default Information": [[47, null]], "Extra Data": [[26, "extra-data"]], "Fixtures": [[39, null]], "Forked Networks": [[31, null]], "Forked network defaults": [[31, "forked-network-defaults"]], "Forking": [[31, "forking"]], "From source": [[50, "from-source"]], "Gas Profiling": [[40, null]], "Getting Started": [[52, null]], "Getting a deployment by contract name": [[25, "getting-a-deployment-by-contract-name"]], "Getting started with ZKsync": [[53, null]], "Help command": [[34, "help-command"]], "How it works": [[42, "how-it-works"]], "How to read the documentation": [[49, "how-to-read-the-documentation"]], "How to use staging markers": [[42, "how-to-use-staging-markers"]], "How-to Guides": [[52, null]], "Importing from src": [[34, "importing-from-src"]], "In a virtual environment (uv pip install, uv add, or pip install)": [[24, "in-a-virtual-environment-uv-pip-install-uv-add-or-pip-install"]], "In an isolated environment (uv tool install or pipx install)": [[24, "in-an-isolated-environment-uv-tool-install-or-pipx-install"]], "Installation": [[53, "installation"]], "Installation with pip": [[50, "installation-with-pip"]], "Installation with pipx": [[50, "installation-with-pipx"]], "Installation with uv": [[50, "installation-with-uv"]], "Installing GitHub Dependencies": [[22, "installing-github-dependencies"]], "Installing Moccasin": [[50, null]], "Installing uv/pip/PyPI Dependencies": [[22, "installing-uv-pip-pypi-dependencies"]], "Interacting with a contract on multiple networks with one script": [[28, "interacting-with-a-contract-on-multiple-networks-with-one-script"]], "Isolated Environment": [[50, "isolated-environment"]], "Manifest Contract (get_or_deploy_contract)": [[28, null]], "Moccasin": [[49, null], [52, null]], "MoccasinAccount": [[2, null]], "Named Arguments": [[7, "moccasin_wrapper_for_docs-get_main_parser-named-arguments"], [7, "named-arguments"], [7, "named-arguments_repeat1"], [7, "named-arguments_repeat2"], [7, "named-arguments_repeat3"], [7, "named-arguments_repeat4"], [7, "named-arguments_repeat5"], [7, "named-arguments_repeat6"], [7, "named-arguments_repeat7"], [7, "named-arguments_repeat8"], [7, "named-arguments_repeat9"], [7, "named-arguments_repeat10"], [7, "named-arguments_repeat11"], [7, "named-arguments_repeat12"], [7, "named-arguments_repeat13"], [7, "named-arguments_repeat14"], [7, "named-arguments_repeat15"], [7, "named-arguments_repeat16"], [8, "moccasin_wrapper_for_docs-get_compile-named-arguments"], [9, "moccasin_wrapper_for_docs-get_config-named-arguments"], [10, "moccasin_wrapper_for_docs-get_console-named-arguments"], [11, "moccasin_wrapper_for_docs-get_deploy-named-arguments"], [12, "moccasin_wrapper_for_docs-get_deployments-named-arguments"], [13, "moccasin_wrapper_for_docs-get_explorer-named-arguments"], [13, "named-arguments"], [13, "named-arguments_repeat1"], [14, "moccasin_wrapper_for_docs-get_init-named-arguments"], [16, "moccasin_wrapper_for_docs-get_install-named-arguments"], [17, "moccasin_wrapper_for_docs-get_purge-named-arguments"], [18, "moccasin_wrapper_for_docs-get_run-named-arguments"], [19, "moccasin_wrapper_for_docs-get_test-named-arguments"], [20, "moccasin_wrapper_for_docs-get_wallet-named-arguments"], [20, "named-arguments"], [20, "named-arguments_repeat1"]], "Named Contract Example - Interacting with the contract": [[27, "named-contract-example-interacting-with-the-contract"]], "Named Contract Example - Minimal Example": [[27, "named-contract-example-minimal-example"]], "Named Contracts": [[27, null]], "NamedContract": [[3, null]], "Network": [[4, null]], "Networking": [[34, "networking"]], "Networks": [[29, null]], "Order Of Operations": [[26, "order-of-operations"]], "Positional Arguments": [[7, "moccasin_wrapper_for_docs-get_main_parser-positional-arguments"], [7, "positional-arguments"], [7, "positional-arguments_repeat1"], [7, "positional-arguments_repeat2"], [7, "positional-arguments_repeat3"], [7, "positional-arguments_repeat4"], [7, "positional-arguments_repeat5"], [7, "positional-arguments_repeat6"], [7, "positional-arguments_repeat7"], [7, "positional-arguments_repeat8"], [7, "positional-arguments_repeat9"], [7, "positional-arguments_repeat10"], [7, "positional-arguments_repeat11"], [7, "positional-arguments_repeat12"], [7, "positional-arguments_repeat13"], [7, "positional-arguments_repeat14"], [7, "positional-arguments_repeat15"], [7, "positional-arguments_repeat16"], [7, "positional-arguments_repeat17"], [8, "moccasin_wrapper_for_docs-get_compile-positional-arguments"], [11, "moccasin_wrapper_for_docs-get_deploy-positional-arguments"], [12, "moccasin_wrapper_for_docs-get_deployments-positional-arguments"], [13, "moccasin_wrapper_for_docs-get_explorer-positional-arguments"], [13, "positional-arguments"], [14, "moccasin_wrapper_for_docs-get_init-positional-arguments"], [15, "moccasin_wrapper_for_docs-get_inspect-positional-arguments"], [16, "moccasin_wrapper_for_docs-get_install-positional-arguments"], [17, "moccasin_wrapper_for_docs-get_purge-positional-arguments"], [18, "moccasin_wrapper_for_docs-get_run-positional-arguments"], [19, "moccasin_wrapper_for_docs-get_test-positional-arguments"], [20, "moccasin_wrapper_for_docs-get_wallet-positional-arguments"], [20, "positional-arguments"], [20, "positional-arguments_repeat1"], [20, "positional-arguments_repeat2"], [20, "positional-arguments_repeat3"], [20, "positional-arguments_repeat4"]], "Pranking": [[41, null]], "Prerequisites": [[50, "prerequisites"]], "Private Keys": [[46, null]], "Project Layout": [[33, null]], "Python packages in your scripts": [[24, null]], "Quickstart": [[51, null]], "Reference": [[52, null]], "Removing Dependencies (Purge)": [[23, null]], "Removing a GitHub dependency": [[23, "removing-a-github-dependency"]], "Removing a pypi/pip dependency": [[23, "removing-a-pypi-pip-dependency"]], "Running eravm": [[30, "running-eravm"]], "Running tests": [[51, "running-tests"]], "Scripting": [[34, null]], "Scripting with Moccasin": [[34, "scripting-with-moccasin"]], "Staging Markers": [[42, null]], "Sub-commands": [[7, "Sub-commands"], [7, "Sub-commands_repeat1"], [7, "Sub-commands_repeat2"], [7, "Sub-commands_repeat3"], [13, "Sub-commands"], [20, "Sub-commands"]], "TOML Formatting": [[0, "toml-formatting"], [49, "toml-formatting"]], "Testing": [[37, null], [53, "testing"]], "The idea": [[42, "the-idea"]], "Titanoboa Testing": [[43, null]], "Tutorials": [[52, null]], "Using Fixtures": [[39, "using-fixtures"]], "ValueError: .eoa not defined!": [[21, "valueerror-boa-network-networkenv-object-at-0xxxxxxxxxx-eoa-not-defined"]], "Virtual Environment": [[50, "virtual-environment"]], "Vyper Compiler Options": [[33, "vyper-compiler-options"]], "Wallet": [[44, null]], "What are fixtues?": [[39, "what-are-fixtues"]], "What if I want my staging test to also run on my local networks?": [[42, "what-if-i-want-my-staging-test-to-also-run-on-my-local-networks"]], "What is Forking": [[31, "what-is-forking"]], "Why Moccasin?": [[49, "why-moccasin"]], "Working with dependencies": [[34, "working-with-dependencies"]], "_Networks": [[5, null]], "compile": [[8, null]], "compile (build)": [[7, "compile (build)"]], "config": [[7, "config"], [9, null]], "console": [[7, "console"], [10, null]], "decrypt (dk)": [[7, "decrypt (dk)"], [20, "decrypt (dk)"]], "delete (d)": [[7, "delete (d)"], [20, "delete (d)"]], "deploy": [[7, "deploy"], [11, null]], "deployments": [[7, "deployments"], [12, null]], "eravm": [[30, null]], "eravm network defaults": [[30, "eravm-network-defaults"]], "explorer": [[7, "explorer"], [13, null]], "fetch (get)": [[7, "fetch (get)"], [13, "fetch (get)"]], "generate (g, new)": [[7, "generate (g, new)"], [20, "generate (g, new)"]], "import (i, add)": [[7, "import (i, add)"], [20, "import (i, add)"]], "init": [[7, "init"], [14, null]], "inspect": [[7, "inspect"], [15, null]], "install": [[7, "install"], [16, null]], "list": [[7, "list"], [13, "list"]], "list (ls)": [[7, "list (ls)"], [20, "list (ls)"]], "moccasin.toml": [[26, null]], "moccasin_main": [[34, "moccasin-main"]], "mox": [[6, "mox"], [7, "mox"]], "purge": [[7, "purge"], [17, null]], "pyevm": [[32, null]], "pyevm network defaults": [[32, "pyevm-network-defaults"]], "pyproject.toml": [[26, "pyproject-toml"]], "run": [[18, null]], "run (script)": [[7, "run (script)"]], "test": [[7, "test"], [19, null]], "utils (u, util)": [[7, "utils (u, util)"]], "view": [[7, "view"], [20, "view"]], "wallet": [[7, "wallet"], [20, null]], "zero (zero-address, zero_address, address-zero, address_zero)": [[7, "zero (zero-address, zero_address, address-zero, address_zero)"]]}, "docnames": ["all_moccasin_toml_parameters", "api_reference/config_reference", "api_reference/moccasin_account_reference", "api_reference/named_contract_reference", "api_reference/network_reference", "api_reference/networks_reference", "class_reference", "cli_commands", "cli_reference/compile", "cli_reference/config", "cli_reference/console", "cli_reference/deploy", "cli_reference/deployments", "cli_reference/explorer", "cli_reference/init", "cli_reference/inspect", "cli_reference/install", "cli_reference/purge", "cli_reference/run", "cli_reference/test", "cli_reference/wallet", "common_errors", "core_concepts/dependencies", "core_concepts/dependencies/purging", "core_concepts/dependencies/virtual_environments", "core_concepts/deployments", "core_concepts/moccasin_toml", "core_concepts/named_contracts", "core_concepts/named_contracts/manifest_contract", "core_concepts/networks", "core_concepts/networks/eravm", "core_concepts/networks/forked_networks", "core_concepts/networks/pyevm", "core_concepts/project", "core_concepts/script", "core_concepts/scripting/console", "core_concepts/scripting/deploy", "core_concepts/testing", "core_concepts/testing/coverage", "core_concepts/testing/fixtures", "core_concepts/testing/gas_profiling", "core_concepts/testing/pranking", "core_concepts/testing/staging_markers", "core_concepts/testing/titanoboa_testing", "core_concepts/wallet", "core_concepts/wallet/config_keys", "core_concepts/wallet/private_key", "explorer_network_defaults", "how-tos/verify_contracts", "index", "installing_moccasin", "quickstart", "toctree", "tutorials/zksync-getting-started"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["all_moccasin_toml_parameters.rst", "api_reference/config_reference.rst", "api_reference/moccasin_account_reference.rst", "api_reference/named_contract_reference.rst", "api_reference/network_reference.rst", "api_reference/networks_reference.rst", "class_reference.rst", "cli_commands.rst", "cli_reference/compile.rst", "cli_reference/config.rst", "cli_reference/console.rst", "cli_reference/deploy.rst", "cli_reference/deployments.rst", "cli_reference/explorer.rst", "cli_reference/init.rst", "cli_reference/inspect.rst", "cli_reference/install.rst", "cli_reference/purge.rst", "cli_reference/run.rst", "cli_reference/test.rst", "cli_reference/wallet.rst", "common_errors.rst", "core_concepts/dependencies.rst", "core_concepts/dependencies/purging.rst", "core_concepts/dependencies/virtual_environments.rst", "core_concepts/deployments.rst", "core_concepts/moccasin_toml.rst", "core_concepts/named_contracts.rst", "core_concepts/named_contracts/manifest_contract.rst", "core_concepts/networks.rst", "core_concepts/networks/eravm.rst", "core_concepts/networks/forked_networks.rst", "core_concepts/networks/pyevm.rst", "core_concepts/project.rst", "core_concepts/script.rst", "core_concepts/scripting/console.rst", "core_concepts/scripting/deploy.rst", "core_concepts/testing.rst", "core_concepts/testing/coverage.rst", "core_concepts/testing/fixtures.rst", "core_concepts/testing/gas_profiling.rst", "core_concepts/testing/pranking.rst", "core_concepts/testing/staging_markers.rst", "core_concepts/testing/titanoboa_testing.rst", "core_concepts/wallet.rst", "core_concepts/wallet/config_keys.rst", "core_concepts/wallet/private_key.rst", "explorer_network_defaults.rst", "how-tos/verify_contracts.rst", "index.rst", "installing_moccasin.rst", "quickstart.rst", "toctree.rst", "tutorials/zksync-getting-started.rst"], "indexentries": {"_networks (class in moccasin.config)": [[5, "moccasin.config._Networks", false]], "abi (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.abi", false]], "abi_from_explorer (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.abi_from_explorer", false]], "activate_boa() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.activate_boa", false]], "activate_boa() (moccasin.config.config method)": [[1, "moccasin.config.Config.activate_boa", false]], "activate_db() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.activate_db", false]], "activate_db() (moccasin.config.config method)": [[1, "moccasin.config.Config.activate_db", false]], "address (moccasin.moccasin_account.moccasinaccount property)": [[2, "moccasin.moccasin_account.MoccasinAccount.address", false]], "address (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.address", false]], "alias (moccasin.config.network property)": [[4, "moccasin.config.Network.alias", false]], "build_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.build_folder", false]], "chain_id (moccasin.config.network attribute)": [[4, "moccasin.config.Network.chain_id", false]], "config (class in moccasin.config)": [[1, "moccasin.config.Config", false]], "config_path (moccasin.config.config property)": [[1, "moccasin.config.Config.config_path", false]], "contract_name (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.contract_name", false]], "contracts (moccasin.config.network attribute)": [[4, "moccasin.config.Network.contracts", false]], "contracts_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.contracts_folder", false]], "convert_deployment_to_contract() (moccasin.config.network static method)": [[4, "moccasin.config.Network.convert_deployment_to_contract", false]], "cov_config (moccasin.config.config property)": [[1, "moccasin.config.Config.cov_config", false]], "create_and_set_or_set_boa_env() (moccasin.config.network method)": [[4, "moccasin.config.Network.create_and_set_or_set_boa_env", false]], "db_path (moccasin.config._networks attribute)": [[5, "moccasin.config._Networks.db_path", false]], "db_path (moccasin.config.network attribute)": [[4, "moccasin.config.Network.db_path", false]], "default_account_name (moccasin.config.network attribute)": [[4, "moccasin.config.Network.default_account_name", false]], "default_network (moccasin.config.config property)": [[1, "moccasin.config.Config.default_network", false]], "default_network_name (moccasin.config._networks attribute)": [[5, "moccasin.config._Networks.default_network_name", false]], "default_network_name (moccasin.config.config property)": [[1, "moccasin.config.Config.default_network_name", false]], "dependencies (moccasin.config.config attribute)": [[1, "moccasin.config.Config.dependencies", false]], "deployer_script (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.deployer_script", false]], "dot_env (moccasin.config.config property)": [[1, "moccasin.config.Config.dot_env", false]], "expand_env_vars() (moccasin.config.config method)": [[1, "moccasin.config.Config.expand_env_vars", false]], "explorer_api_key (moccasin.config.network attribute)": [[4, "moccasin.config.Network.explorer_api_key", false]], "explorer_type (moccasin.config.network attribute)": [[4, "moccasin.config.Network.explorer_type", false]], "explorer_uri (moccasin.config.network attribute)": [[4, "moccasin.config.Network.explorer_uri", false]], "extra_data (moccasin.config.config attribute)": [[1, "moccasin.config.Config.extra_data", false]], "extra_data (moccasin.config.network attribute)": [[4, "moccasin.config.Network.extra_data", false]], "find_contract() (moccasin.config.config method)": [[1, "moccasin.config.Config.find_contract", false]], "find_project_root() (moccasin.config.config static method)": [[1, "moccasin.config.Config.find_project_root", false]], "force_deploy (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.force_deploy", false]], "from_boa_address() (moccasin.moccasin_account.moccasinaccount class method)": [[2, "moccasin.moccasin_account.MoccasinAccount.from_boa_address", false]], "get() (moccasin.named_contract.namedcontract method)": [[3, "moccasin.named_contract.NamedContract.get", false]], "get_active_network() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_active_network", false]], "get_active_network() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_active_network", false]], "get_base_dependencies_install_path() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_base_dependencies_install_path", false]], "get_config_path() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_config_path", false]], "get_db_path() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_db_path", false]], "get_db_path() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_db_path", false]], "get_default_account() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_default_account", false]], "get_dependencies() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_dependencies", false]], "get_deployer_from_contract_name() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_deployer_from_contract_name", false]], "get_deployments_checked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_deployments_checked", false]], "get_deployments_unchecked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_deployments_unchecked", false]], "get_latest_contract_checked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_latest_contract_checked", false]], "get_latest_contract_unchecked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_latest_contract_unchecked", false]], "get_latest_deployment_checked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_latest_deployment_checked", false]], "get_latest_deployment_unchecked() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_latest_deployment_unchecked", false]], "get_named_contract() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_named_contract", false]], "get_named_contracts() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_named_contracts", false]], "get_network() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_network", false]], "get_network_by_chain_id() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_network_by_chain_id", false]], "get_network_by_name() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_network_by_name", false]], "get_networks() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_networks", false]], "get_networks() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_networks", false]], "get_or_deploy_contract() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.get_or_deploy_contract", false]], "get_or_deploy_contract() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_or_deploy_contract", false]], "get_or_deploy_contract() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_or_deploy_contract", false]], "get_root() (moccasin.config.config method)": [[1, "moccasin.config.Config.get_root", false]], "get_verifier_class() (moccasin.config.network method)": [[4, "moccasin.config.Network.get_verifier_class", false]], "has_explorer() (moccasin.config.network method)": [[4, "moccasin.config.Network.has_explorer", false]], "has_matching_integrity() (moccasin.config.network method)": [[4, "moccasin.config.Network.has_matching_integrity", false]], "identifier (moccasin.config.network property)": [[4, "moccasin.config.Network.identifier", false]], "instantiate_contract() (moccasin.config.network method)": [[4, "moccasin.config.Network.instantiate_contract", false]], "is_fork (moccasin.config.network attribute)": [[4, "moccasin.config.Network.is_fork", false]], "is_local_or_forked_network() (moccasin.config.network method)": [[4, "moccasin.config.Network.is_local_or_forked_network", false]], "is_matching_boa() (moccasin.config.network method)": [[4, "moccasin.config.Network.is_matching_boa", false]], "is_zksync (moccasin.config.network attribute)": [[4, "moccasin.config.Network.is_zksync", false]], "lib_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.lib_folder", false]], "live_or_staging (moccasin.config.network attribute)": [[4, "moccasin.config.Network.live_or_staging", false]], "load_config_from_root() (moccasin.config.config static method)": [[1, "moccasin.config.Config.load_config_from_root", false]], "manifest_contract() (moccasin.config.network method)": [[4, "moccasin.config.Network.manifest_contract", false]], "merge_configs() (moccasin.config.config static method)": [[1, "moccasin.config.Config.merge_configs", false]], "moccasin_verify() (moccasin.config.network method)": [[4, "moccasin.config.Network.moccasin_verify", false]], "moccasinaccount (class in moccasin.moccasin_account)": [[2, "moccasin.moccasin_account.MoccasinAccount", false]], "name (moccasin.config.network attribute)": [[4, "moccasin.config.Network.name", false]], "namedcontract (class in moccasin.named_contract)": [[3, "moccasin.named_contract.NamedContract", false]], "nested_tomlkit_update() (moccasin.config.config static method)": [[1, "moccasin.config.Config.nested_tomlkit_update", false]], "network (class in moccasin.config)": [[4, "moccasin.config.Network", false]], "networks (moccasin.config.config attribute)": [[1, "moccasin.config.Config.networks", false]], "out_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.out_folder", false]], "private_key (moccasin.moccasin_account.moccasinaccount property)": [[2, "moccasin.moccasin_account.MoccasinAccount.private_key", false]], "project (moccasin.config.config attribute)": [[1, "moccasin.config.Config.project", false]], "project_root (moccasin.config.config property)": [[1, "moccasin.config.Config.project_root", false]], "prompt_live (moccasin.config.network attribute)": [[4, "moccasin.config.Network.prompt_live", false]], "pyproject_path (moccasin.config.config property)": [[1, "moccasin.config.Config.pyproject_path", false]], "read_configs() (moccasin.config.config method)": [[1, "moccasin.config.Config.read_configs", false]], "read_configs_preserve_comments() (moccasin.config.config method)": [[1, "moccasin.config.Config.read_configs_preserve_comments", false]], "read_moccasin_config() (moccasin.config.config method)": [[1, "moccasin.config.Config.read_moccasin_config", false]], "read_moccasin_toml() (moccasin.config.config static method)": [[1, "moccasin.config.Config.read_moccasin_toml", false]], "read_moccasin_toml_preserve_comments() (moccasin.config.config static method)": [[1, "moccasin.config.Config.read_moccasin_toml_preserve_comments", false]], "read_pyproject_config() (moccasin.config.config method)": [[1, "moccasin.config.Config.read_pyproject_config", false]], "read_pyproject_toml() (moccasin.config.config static method)": [[1, "moccasin.config.Config.read_pyproject_toml", false]], "read_pyproject_toml_preserve_comments() (moccasin.config.config static method)": [[1, "moccasin.config.Config.read_pyproject_toml_preserve_comments", false]], "save_abi_path (moccasin.config.network attribute)": [[4, "moccasin.config.Network.save_abi_path", false]], "save_to_db (moccasin.config.network attribute)": [[4, "moccasin.config.Network.save_to_db", false]], "script_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.script_folder", false]], "set_active_network() (moccasin.config._networks method)": [[5, "moccasin.config._Networks.set_active_network", false]], "set_active_network() (moccasin.config.config method)": [[1, "moccasin.config.Config.set_active_network", false]], "set_boa_eoa() (moccasin.config.network method)": [[4, "moccasin.config.Network.set_boa_eoa", false]], "set_defaults() (moccasin.named_contract.namedcontract method)": [[3, "moccasin.named_contract.NamedContract.set_defaults", false]], "set_keystore_path() (moccasin.moccasin_account.moccasinaccount method)": [[2, "moccasin.moccasin_account.MoccasinAccount.set_keystore_path", false]], "set_kwargs() (moccasin.config.network method)": [[4, "moccasin.config.Network.set_kwargs", false]], "src_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.src_folder", false]], "test_folder (moccasin.config.config property)": [[1, "moccasin.config.Config.test_folder", false]], "unlock() (moccasin.moccasin_account.moccasinaccount method)": [[2, "moccasin.moccasin_account.MoccasinAccount.unlock", false]], "unlocked() (moccasin.moccasin_account.moccasinaccount method)": [[2, "moccasin.moccasin_account.MoccasinAccount.unlocked", false]], "unsafe_password_file (moccasin.config.network attribute)": [[4, "moccasin.config.Network.unsafe_password_file", false]], "update_from_deployed_contract() (moccasin.named_contract.namedcontract method)": [[3, "moccasin.named_contract.NamedContract.update_from_deployed_contract", false]], "url (moccasin.config.network attribute)": [[4, "moccasin.config.Network.url", false]], "vyper_contract (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.vyper_contract", false]], "vyper_deployer (moccasin.named_contract.namedcontract attribute)": [[3, "moccasin.named_contract.NamedContract.vyper_deployer", false]], "write_dependencies() (moccasin.config.config method)": [[1, "moccasin.config.Config.write_dependencies", false]]}, "objects": {"moccasin.config": [[1, 0, 1, "", "Config"], [4, 0, 1, "", "Network"], [5, 0, 1, "", "_Networks"]], "moccasin.config.Config": [[1, 1, 1, "", "activate_boa"], [1, 1, 1, "", "activate_db"], [1, 2, 1, "", "build_folder"], [1, 2, 1, "", "config_path"], [1, 2, 1, "", "contracts_folder"], [1, 2, 1, "", "cov_config"], [1, 2, 1, "", "default_network"], [1, 2, 1, "", "default_network_name"], [1, 3, 1, "", "dependencies"], [1, 2, 1, "", "dot_env"], [1, 1, 1, "", "expand_env_vars"], [1, 3, 1, "", "extra_data"], [1, 1, 1, "", "find_contract"], [1, 1, 1, "", "find_project_root"], [1, 1, 1, "", "get_active_network"], [1, 1, 1, "", "get_base_dependencies_install_path"], [1, 1, 1, "", "get_config_path"], [1, 1, 1, "", "get_db_path"], [1, 1, 1, "", "get_dependencies"], [1, 1, 1, "", "get_networks"], [1, 1, 1, "", "get_or_deploy_contract"], [1, 1, 1, "", "get_root"], [1, 2, 1, "", "lib_folder"], [1, 1, 1, "", "load_config_from_root"], [1, 1, 1, "", "merge_configs"], [1, 1, 1, "", "nested_tomlkit_update"], [1, 3, 1, "", "networks"], [1, 2, 1, "", "out_folder"], [1, 3, 1, "", "project"], [1, 2, 1, "", "project_root"], [1, 2, 1, "", "pyproject_path"], [1, 1, 1, "", "read_configs"], [1, 1, 1, "", "read_configs_preserve_comments"], [1, 1, 1, "", "read_moccasin_config"], [1, 1, 1, "", "read_moccasin_toml"], [1, 1, 1, "", "read_moccasin_toml_preserve_comments"], [1, 1, 1, "", "read_pyproject_config"], [1, 1, 1, "", "read_pyproject_toml"], [1, 1, 1, "", "read_pyproject_toml_preserve_comments"], [1, 2, 1, "", "script_folder"], [1, 1, 1, "", "set_active_network"], [1, 2, 1, "", "src_folder"], [1, 2, 1, "", "test_folder"], [1, 1, 1, "", "write_dependencies"]], "moccasin.config.Network": [[4, 2, 1, "", "alias"], [4, 3, 1, "", "chain_id"], [4, 3, 1, "", "contracts"], [4, 1, 1, "", "convert_deployment_to_contract"], [4, 1, 1, "", "create_and_set_or_set_boa_env"], [4, 3, 1, "", "db_path"], [4, 3, 1, "", "default_account_name"], [4, 3, 1, "", "explorer_api_key"], [4, 3, 1, "", "explorer_type"], [4, 3, 1, "", "explorer_uri"], [4, 3, 1, "", "extra_data"], [4, 1, 1, "", "get_default_account"], [4, 1, 1, "", "get_deployer_from_contract_name"], [4, 1, 1, "", "get_deployments_checked"], [4, 1, 1, "", "get_deployments_unchecked"], [4, 1, 1, "", "get_latest_contract_checked"], [4, 1, 1, "", "get_latest_contract_unchecked"], [4, 1, 1, "", "get_latest_deployment_checked"], [4, 1, 1, "", "get_latest_deployment_unchecked"], [4, 1, 1, "", "get_named_contract"], [4, 1, 1, "", "get_named_contracts"], [4, 1, 1, "", "get_or_deploy_contract"], [4, 1, 1, "", "get_verifier_class"], [4, 1, 1, "", "has_explorer"], [4, 1, 1, "", "has_matching_integrity"], [4, 2, 1, "", "identifier"], [4, 1, 1, "", "instantiate_contract"], [4, 3, 1, "", "is_fork"], [4, 1, 1, "", "is_local_or_forked_network"], [4, 1, 1, "", "is_matching_boa"], [4, 3, 1, "", "is_zksync"], [4, 3, 1, "", "live_or_staging"], [4, 1, 1, "", "manifest_contract"], [4, 1, 1, "", "moccasin_verify"], [4, 3, 1, "", "name"], [4, 3, 1, "", "prompt_live"], [4, 3, 1, "", "save_abi_path"], [4, 3, 1, "", "save_to_db"], [4, 1, 1, "", "set_boa_eoa"], [4, 1, 1, "", "set_kwargs"], [4, 3, 1, "", "unsafe_password_file"], [4, 3, 1, "", "url"]], "moccasin.config._Networks": [[5, 1, 1, "", "activate_boa"], [5, 1, 1, "", "activate_db"], [5, 3, 1, "", "db_path"], [5, 3, 1, "", "default_network_name"], [5, 1, 1, "", "get_active_network"], [5, 1, 1, "", "get_db_path"], [5, 1, 1, "", "get_network"], [5, 1, 1, "", "get_network_by_chain_id"], [5, 1, 1, "", "get_network_by_name"], [5, 1, 1, "", "get_networks"], [5, 1, 1, "", "get_or_deploy_contract"], [5, 1, 1, "", "set_active_network"]], "moccasin.moccasin_account": [[2, 0, 1, "", "MoccasinAccount"]], "moccasin.moccasin_account.MoccasinAccount": [[2, 2, 1, "", "address"], [2, 1, 1, "", "from_boa_address"], [2, 2, 1, "", "private_key"], [2, 1, 1, "", "set_keystore_path"], [2, 1, 1, "", "unlock"], [2, 1, 1, "", "unlocked"]], "moccasin.named_contract": [[3, 0, 1, "", "NamedContract"]], "moccasin.named_contract.NamedContract": [[3, 3, 1, "", "abi"], [3, 3, 1, "", "abi_from_explorer"], [3, 3, 1, "", "address"], [3, 3, 1, "", "contract_name"], [3, 3, 1, "", "deployer_script"], [3, 3, 1, "", "force_deploy"], [3, 1, 1, "", "get"], [3, 1, 1, "", "set_defaults"], [3, 1, 1, "", "update_from_deployed_contract"], [3, 3, 1, "", "vyper_contract"], [3, 3, 1, "", "vyper_deployer"]]}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"], "2": ["py", "property", "Python property"], "3": ["py", "attribute", "Python attribute"]}, "objtypes": {"0": "py:class", "1": "py:method", "2": "py:property", "3": "py:attribute"}, "terms": {"": [0, 7, 10, 11, 12, 16, 18, 19, 22, 24, 27, 28, 29, 31, 34, 38, 40, 42, 45, 46, 48, 49, 50, 51, 53], "0": [0, 7, 12, 16, 22, 25, 26, 28, 33, 37, 38, 39, 40, 50, 51, 53], "01": [37, 51], "04ea": 44, "07": 53, "09": 53, "0x0000000000000000000000000000000000000065": 41, "0x0000000000000000000000000000000000000066": 40, "0x02": 22, "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef": 46, "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238": 28, "0x2dc0e2aa608532da689e89e237df582b783e552c": 47, "0x5b5cfe992adac0c9d48e05854b2d91c73a003858": 47, "0x5ba1e12693dc8f9c48aad8770482f4739beed696": 47, "0x5fbdb2315678afecb367f032d93f642f64180aa3": 0, "0x6b175474e89094c44da98b954eedeac495271d0f": 0, "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": [27, 28], "0xaf88d065e77c8cc2239327c5edb3a432268e5831": 28, "0xc8e51042792d7405184dfca245f2d27b94d013b6": 47, "0xd8da6bf26964af9d7eed9e03e53415d37aa96045": 41, "0xf0109fc8df283027b6285cc889f5aa624eac1f55": 2, "1": [0, 4, 7, 8, 12, 16, 22, 25, 26, 27, 37, 38, 40, 44, 47, 50, 51], "10": [38, 47, 49, 50], "100": [37, 38, 47, 51], "10200": 47, "106": 47, "108": [47, 51], "1088": 47, "11": [26, 37, 38, 50, 51], "1101": 47, "11155111": [0, 26, 29, 31, 47, 49], "1116": 47, "112": 37, "1135": 47, "122": 47, "128": [44, 47], "13": 26, "1313161554": 47, "137": 47, "14": 38, "148": 47, "15": [38, 40], "16": 38, "167000": 47, "169": 47, "1729": 47, "18": 22, "1975": 47, "1992": 47, "1996": 47, "2": [4, 7, 8, 12, 37, 38, 39, 42, 51], "2000": 47, "2001": 47, "2024": 53, "2222": 47, "24": 38, "245022934": 47, "246": 47, "248": 47, "262144": 44, "2nd": 49, "3": [4, 7, 8, 12, 26, 28, 37, 38, 44, 50, 51], "300": 47, "311": 47, "314": 47, "32": 44, "321": 47, "324": [0, 47, 49], "336": 47, "34": 38, "39": 38, "4": [7, 12, 25, 28, 33, 40, 53], "4120": 44, "420": 47, "42161": 47, "42220": 47, "42262": 47, "44": 38, "45": 38, "5": [37, 40, 47, 51, 53], "50": 38, "5000": 47, "534352": 47, "57": 47, "570": 47, "59144": 47, "592": 47, "6": [37, 38, 51], "61": 47, "62dbc22cce0e270a71a5ac1a8c57b04eafa215839abcbdb9f349d63b6b9e5e9f": 44, "66": 37, "7": 38, "70": 38, "7000": 47, "71326ecf78c3a2f2087366e4516d44f1": 44, "73": 40, "7777777": 47, "8": [37, 38, 44, 51], "81457": 47, "820": 47, "8453": 47, "87": 47, "88": 40, "9": [38, 51], "90": 38, "957": 47, "996": 47, "A": [0, 1, 4, 7, 19, 25, 26, 27, 28, 33, 42, 49], "AT": [7, 10, 49], "And": [23, 24, 25, 27, 28, 34, 37, 38, 40, 43, 44, 49, 50, 51, 53], "As": [27, 48, 53], "At": 28, "BE": 29, "Be": 28, "But": [0, 25, 42, 50, 51], "By": [33, 44, 46], "For": [7, 15, 19, 22, 25, 26, 27, 28, 29, 31, 34, 39, 50], "IF": 29, "If": [0, 1, 4, 7, 8, 13, 16, 24, 26, 27, 28, 29, 32, 33, 34, 39, 42, 49, 50, 51], "In": [0, 25, 26, 28, 30, 31, 33, 34, 36, 42, 48, 49], "It": [0, 22, 25, 27, 31, 40, 44, 45, 50], "ONE": 28, "One": [27, 39], "Or": 50, "TO": 29, "That": [48, 53], "The": [0, 1, 2, 4, 7, 10, 11, 12, 13, 16, 18, 19, 25, 26, 27, 28, 29, 30, 36, 45, 48, 49, 50], "Then": [28, 39, 42, 49, 50], "There": [25, 27, 31, 34, 50], "These": [0, 28], "To": [22, 23, 27, 38, 40, 42, 48, 50, 51, 53], "With": [22, 24], "__init__": [22, 28, 38, 51], "__interface__": 22, "_local": [3, 4], "_network": [1, 6, 52], "_network_env": 4, "_project_root": 1, "_toml_data": 1, "a178051e8": 53, "abi": [0, 3, 4, 7, 13, 15, 25, 27, 28, 39], "abi_contract": 25, "abi_from_explor": [3, 4, 27], "abicontract": [1, 4, 5, 25], "abicontractfactori": 4, "abil": 39, "abl": [24, 28, 50], "about": [0, 4, 25, 26, 27, 34], "abov": 42, "abstract": 53, "access": [7, 15, 26, 27], "account": [0, 2, 4, 7, 10, 11, 18, 19, 20, 21, 29, 31, 34, 36, 44, 52, 53], "account_nam": 44, "accumul": [7, 19], "across": 39, "activ": [4, 24, 25, 49, 50], "activate_boa": [1, 5], "activate_db": [1, 5], "active_network": [25, 27, 28, 48], "actual": 0, "ad": [7, 13, 19, 31], "add": [0, 13, 14, 19, 21, 22, 26, 32, 44, 50, 51], "addit": 1, "addition": [0, 7, 19, 28, 45], "address": [0, 2, 3, 4, 12, 13, 25, 27, 28, 39, 40, 41, 44, 48], "adjust": [26, 28, 33], "ae": 44, "after": [34, 42], "against": [7, 19], "ai": [39, 49], "aka": [26, 28], "alert": 45, "alia": [4, 5, 7, 8, 10, 11, 12, 13, 18, 19, 34, 36], "all": [6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 25, 26, 28, 29, 34, 36, 37, 42, 43, 44, 49, 52], "allow": [7, 19, 22, 26, 27, 31, 49, 50], "almost": 1, "along": [30, 50], "alreadi": 51, "also": [0, 1, 7, 13, 22, 26, 31, 34, 38, 39, 45, 46, 51], "an": [4, 7, 10, 11, 13, 18, 19, 20, 21, 22, 25, 26, 27, 28, 31, 33, 34, 36, 37, 38, 39, 40, 44, 45, 49, 50, 51], "andromeda": 47, "ani": [1, 3, 4, 7, 19, 22, 25, 26, 27, 31, 32, 38, 42, 50, 53], "annot": [7, 19], "anvil": [0, 25, 29], "anvil1": 45, "anyth": 1, "api": [0, 6, 7, 13], "api_kei": [7, 13], "api_refer": 25, "append": [7, 19], "appli": [7, 13], "applic": [27, 50], "appropri": 50, "apt": 50, "ar": [0, 4, 7, 16, 19, 22, 25, 27, 28, 29, 33, 34, 38, 48, 49, 50, 53], "arbitrum": [28, 47], "arg": [1, 4, 5], "argument": [4, 34, 36, 44, 49], "around": [1, 4], "artifact": [7, 8], "artifici": 49, "ask": [39, 44], "assembli": [7, 15], "assert": [37, 39, 42], "assign": [7, 19, 25, 42], "assum": 49, "astar": 47, "astral": 50, "attempt": [7, 13, 45], "attribut": 1, "aurora": 47, "auth": 22, "automat": [0, 25, 28, 29, 45], "avail": [48, 50], "aw": 28, "awesom": 51, "b": 25, "b55fbb0baad": 44, "b6a4": 44, "balanc": 31, "base": [1, 2, 3, 4, 5, 7, 12, 25, 37, 47], "baselin": 39, "basic": [0, 7, 14, 37], "becaus": [28, 31, 43, 49], "befor": [0, 28, 50], "beginn": 50, "being": 4, "below": 50, "beta": [7, 10, 49], "better": 46, "between": 27, "bifrost": 47, "bifrostnetwork": 47, "bin": [24, 50], "binari": 27, "bit": 31, "blank": 4, "blast": 47, "blindli": 31, "block": [7, 13, 31, 49], "blockchain": 31, "blockscount": 48, "blockscout": [0, 47], "blockscoutapi": 47, "blog": 27, "boa": [3, 4, 7, 19, 25, 37, 41, 52], "boa_tool": 32, "bool": [1, 2, 3, 4], "boolean": 42, "bore": 27, "bot": 39, "both": [22, 23, 25, 26, 29, 39], "branch": [7, 19, 38], "break": 27, "brew": [50, 51], "brpart": 38, "build": [0, 47, 49, 53], "build_fold": 1, "built": [22, 25, 27, 28, 30, 32, 40, 48], "byte": 2, "bytecod": [7, 15, 25], "c": 50, "c1": 47, "cabail": 27, "cach": [7, 19], "call": [25, 31, 32, 48], "callisto": 47, "can": [0, 4, 6, 7, 13, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 53], "cannot": [0, 29], "captur": [7, 19], "cardano": 47, "care": 0, "case": [7, 19, 27, 28], "cd": [50, 51], "celo": 47, "chain": [7, 13, 27, 28, 29, 47], "chain_id": [0, 4, 5, 7, 13, 26, 27, 29, 31, 47, 49], "chang": [0, 25, 28], "chat": 39, "check": [4, 7, 12, 42, 48, 50, 51], "checksum": 2, "checksumaddress": 2, "chiado": 47, "choic": [7, 13, 15, 20, 49], "cipher": 44, "cipherparam": 44, "ciphertext": 44, "citizen": 31, "class": [1, 2, 3, 4, 5, 7, 19, 25, 31, 52], "classmethod": 2, "clear": [7, 19], "cli": [33, 34, 36, 44, 49, 50, 52], "clone": 50, "code": [7, 12, 25, 26, 37, 39, 48], "collect": [37, 51], "com": [0, 26, 27, 29, 31, 47, 50], "come": [22, 25, 27, 28, 30, 32, 38, 42, 48, 50], "command": [8, 15, 23, 24, 26, 28, 29, 31, 32, 33, 35, 36, 37, 44, 45, 46, 49, 50, 51, 52], "commandlin": 50, "common": 52, "compact": [0, 49], "compar": [7, 12, 25], "compat": [7, 16, 17, 50], "compil": [15, 49, 51, 52, 53], "complet": 29, "comput": [40, 49], "config": [0, 4, 5, 6, 11, 13, 19, 25, 26, 27, 28, 36, 42, 49, 52], "config_nam": [7, 10, 11, 12, 18, 19], "config_or_db_path": 4, "config_path": 1, "config_refer": 25, "configfil": 37, "configur": [0, 1, 7, 9, 19, 26, 28, 33, 38, 39, 49, 51], "conflict": 50, "conftest": [7, 14, 34, 39, 51], "connect": [28, 29, 31, 39], "consid": 32, "consol": [20, 34, 49, 52], "constructor": 28, "contain": [7, 10, 11, 18, 19, 20, 29, 33, 34, 36, 51], "content": [7, 19, 44], "context": [7, 18, 19, 34, 49], "continu": 28, "contract": [0, 3, 4, 7, 8, 11, 12, 13, 15, 22, 26, 29, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 49, 52, 53], "contract_nam": [3, 4, 7, 11, 12, 25, 36], "contract_or_contract_path": [1, 7, 8], "contracts_fold": 1, "control": 39, "convert": 25, "convert_deployment_to_contract": 4, "copi": 31, "core": [32, 47], "correct": 28, "could": [25, 27, 31, 34], "count": [32, 34, 40, 51], "counter": [7, 14, 15, 25, 32, 34, 38, 48, 51], "counter_contract": [25, 37, 42], "cours": 51, "cov": [7, 19, 37, 38, 51], "cov_config": [0, 1, 7, 19, 38], "cov_context": [7, 19], "cov_fail_und": [7, 19], "cov_report": [7, 19], "cover": [7, 19, 38], "coverag": [0, 7, 19, 37, 51, 52], "coveragerc": [0, 38, 51], "creat": [7, 14, 20, 22, 26, 28, 29, 31, 39, 44, 48, 50], "create_and_set_or_set_boa_env": 4, "crypto": 44, "ctr": 44, "curl": 50, "current": [4, 7, 12, 14, 19, 25], "custom": 53, "cut": [7, 19], "cyfrin": [27, 50], "d": [8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 24, 26, 28, 33, 34, 36, 39, 44, 49, 50], "dai": [0, 39], "darwin": [37, 38, 51], "data": [1, 7, 13, 15, 19, 29, 39, 49], "databas": [0, 7, 10, 11, 12, 18, 19, 25, 29, 39], "db": [0, 7, 10, 11, 12, 18, 19, 25, 29, 49], "db_path": [0, 4, 5, 7, 10, 11, 12, 18, 19, 25, 29], "deactiv": 24, "debug": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 36, 44, 49], "debugg": [7, 19], "decc1fbd482a171578028bfb2563362b9f4857765d6247900bde22e0cd6c2c13": 44, "decim": [27, 28, 33, 39], "decor": 0, "decrypt": [44, 45], "def": [22, 25, 27, 28, 32, 34, 37, 39, 40, 42, 48, 51], "default": [0, 1, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 25, 26, 28, 29, 33, 34, 38, 44, 46, 48, 52], "default_account_nam": [0, 4, 29, 45], "default_network": [0, 1], "default_network_nam": [1, 5], "defin": [26, 27, 34, 36, 39], "delet": [19, 44], "depend": [0, 1, 7, 16, 17, 24, 26, 49, 50, 51, 52], "deploi": [0, 4, 14, 18, 22, 25, 27, 28, 29, 32, 33, 34, 38, 39, 42, 44, 45, 46, 48, 49, 52, 53], "deploy": [0, 4, 8, 10, 11, 18, 19, 27, 28, 29, 49, 52], "deploy_and_verifi": 48, "deploy_coffe": 38, "deploy_erc20": 27, "deploy_fe": [28, 38, 39], "deploy_usdc": 36, "deployed_contract": 3, "deployer_script": [0, 3, 4, 28, 36, 39], "deployment_script": 27, "describ": [33, 51], "descript": 26, "dest": [7, 19], "detail": 48, "determin": [0, 7, 12], "dev": [47, 48], "develop": [7, 25, 27, 28, 31, 42, 49, 50], "devop": 49, "dict": [1, 4, 5], "dictionari": [26, 29], "did": [27, 53], "didn": 32, "differ": [26, 28, 38, 39, 50], "differenti": 27, "directli": [7, 15, 19, 22, 28, 34, 35, 36, 50], "directori": [0, 1, 7, 8, 14, 19, 20, 33, 34, 39, 44, 51], "disabl": [7, 19], "discourag": [29, 33, 46], "dk": 44, "dklen": 44, "do": [0, 1, 7, 15, 19, 21, 22, 27, 28, 32, 34, 39, 42, 50, 53], "document": [26, 34, 38, 39, 40, 51], "doe": [25, 27, 31, 50, 53], "doesn": [25, 27, 28], "dog": 47, "dogechain": 47, "don": [0, 7, 13, 19, 24, 26, 27, 28, 29, 31, 32, 42, 44, 50], "dot_env": [0, 1, 26], "down": 27, "download": [7, 16, 22, 31], "durat": [32, 45], "e": 50, "e6966dcf6d5384f050052f71ed7bfc02": 44, "ea0a89c0": 44, "each": [0, 7, 8, 19, 25, 26, 28, 34, 49], "earth": 49, "easi": [49, 51], "easier": [48, 51], "easiest": 50, "easili": 0, "edit": [7, 12], "either": [22, 25, 34, 50], "elif": 28, "elimin": [7, 19], "els": [0, 28], "emerald": 47, "enabl": [7, 19, 33], "encrypt": [7, 20, 45, 46], "end": [32, 34, 50, 51], "endpoint": [7, 13], "energi": 47, "energyweb": 47, "engin": [32, 49], "enough": 22, "ensurepath": 50, "enter": [28, 35, 44], "entri": [1, 22], "env": [0, 4, 26, 41], "environ": [7, 13, 27, 30, 39, 51], "eoa": 41, "equival": [36, 39], "era": [0, 30, 47, 48, 53], "era_test_nod": 53, "eravm": [0, 4, 29, 42, 52, 53], "erc20": [0, 22, 27, 28, 39], "error": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 29, 34, 36, 44, 49, 52], "essenti": [0, 31, 36, 49], "etc": [42, 47], "eth": [27, 47], "ethereum": [0, 26, 27, 29, 31, 51], "ethereumclass": 47, "etherscan": [0, 7, 13], "etherscan_api_kei": [7, 13, 26], "evalu": [7, 19], "even": [4, 26, 50], "ever": [42, 44], "everi": 28, "everyth": [7, 12, 28, 31, 42], "evm": [0, 47], "evmexplor": 47, "exactli": 28, "exampl": [0, 7, 15, 16, 19, 22, 25, 26, 28, 29, 31, 33, 34, 39, 42, 45], "except": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 36, 42, 44, 49], "exclus": 4, "execut": 50, "exhaust": 26, "exist": [1, 7, 14, 27, 28], "exit": [7, 19, 34, 35, 36, 44, 49], "exitfirst": [7, 19], "expand": [0, 49], "expand_env_var": 1, "expect": [24, 28], "explicit": 4, "explicitli": 22, "explor": [0, 4, 27, 49, 52], "explorer_api_kei": [0, 4, 26, 27, 48], "explorer_command": [7, 13], "explorer_typ": [0, 4, 47, 48], "explorer_uri": [0, 4, 48], "export": 22, "expos": 44, "express": [7, 19], "extern": [25, 28], "extra": [7, 19, 29], "extra_data": [0, 1, 4, 26, 29], "extra_keyword_match": [7, 19], "f": [7, 12, 14], "f39fd6e51aad88f6f4ce6ab8827279cfffb92266": 44, "f9f732c8ebdb88fb8cd4528482a00e4f65bcb8b7": 53, "factori": 4, "fail": [7, 19], "fals": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 25, 27, 29, 30, 31, 32, 42], "far": [7, 19], "fast": [49, 50], "favorit": 51, "fd": [7, 19], "featur": [39, 41, 43], "fetch": 4, "few": [0, 25, 50], "file": [0, 1, 4, 7, 8, 10, 11, 14, 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, 33, 34, 36, 38, 39, 42, 44, 45, 51], "file_or_dir": [7, 19], "filecoin": 47, "filenam": 25, "final": [38, 49], "financ": 47, "find": [6, 7, 8, 25, 29], "find_contract": 1, "find_project_root": 1, "first": [1, 7, 16, 19, 28, 31, 49, 50, 51], "fix": 39, "fixtur": [0, 27, 28, 37, 52], "flag": [0, 7, 13, 24, 25, 26, 27, 28, 29, 31, 32, 38, 39, 45, 50], "flexibl": [27, 28], "flight": 31, "float": 1, "fly": [26, 33, 51], "folder": [0, 7, 18, 19, 22, 23, 33, 34, 51], "follow": [4, 7, 19, 21, 22, 23, 25, 27, 28, 30, 33, 34, 48, 49, 50, 51, 53], "foo": 40, "foocontract": 40, "forc": [7, 14, 27, 51], "force_deploi": [0, 3, 4, 27], "fork": [0, 4, 7, 10, 11, 12, 18, 19, 25, 27, 28, 29, 34, 36, 42, 52], "forked_chain": 28, "formal": 49, "format": [7, 12, 13, 16, 17, 27], "format_level": [7, 12], "forwardref": 4, "found": [4, 44], "framework": [7, 49, 51], "from": [0, 1, 4, 7, 8, 10, 11, 12, 13, 16, 18, 19, 22, 23, 25, 26, 27, 28, 29, 31, 32, 36, 39, 49, 51], "from_boa_address": 2, "full": [7, 19, 26, 29], "fun": 49, "function": [4, 7, 15, 19, 25, 27, 28, 34, 39, 40, 41, 48], "fuse": 47, "futur": [27, 49], "fuzz": [43, 49], "g": 44, "ga": [7, 19, 37, 38, 52], "game": 47, "gener": [19, 44], "get": [3, 10, 11, 12, 15, 18, 19, 20, 27, 30, 31, 32, 34, 36, 37, 38, 40, 44, 49, 50, 51], "get_active_network": [1, 5, 25, 27, 28, 48], "get_base_dependencies_install_path": 1, "get_config": [25, 26, 27, 28], "get_config_path": 1, "get_db_path": [1, 5], "get_decim": 28, "get_default_account": 4, "get_depend": 1, "get_deployer_from_contract_nam": 4, "get_deployments_check": [4, 25], "get_deployments_uncheck": [4, 25], "get_latest_contract_check": [4, 25], "get_latest_contract_uncheck": [4, 25], "get_latest_deployment_check": [4, 25], "get_latest_deployment_uncheck": [4, 25], "get_named_contract": [4, 27], "get_network": [1, 5], "get_network_by_chain_id": 5, "get_network_by_nam": 5, "get_or_deploy_contract": [1, 4, 5, 25], "get_root": 1, "get_usdc_bal": 38, "get_usdc_decim": 28, "get_verifier_class": 4, "giant": [0, 49], "git": [50, 51], "gitattribut": 51, "github": [0, 7, 16, 17, 29, 50], "github_org": [7, 16], "github_repo": [7, 16], "gitignor": 51, "give": [27, 39], "given": [4, 7, 8, 13, 16, 17, 19, 25, 49], "gnosi": 47, "go": [0, 22, 50, 51], "goerli": 47, "good": 4, "gotten": 51, "guid": 21, "h": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 34, 36, 44, 49], "ha": [0, 4, 26, 28, 40, 42, 43, 51], "had": 42, "handl": [51, 53], "happen": [28, 31], "has_explor": 4, "has_matching_integr": [4, 25], "hash": [7, 12, 25], "have": [0, 7, 19, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 36, 39, 42, 44, 48, 49, 50, 53], "head": [49, 50], "heavili": 49, "heco": 47, "height": 31, "hello": [0, 26], "help": [7, 27, 28, 31, 36, 44, 49, 50, 51], "here": [0, 25, 26, 27, 28, 29], "hexbyt": 2, "hi": 0, "hidden": 51, "highli": [24, 29, 50], "hit": 35, "hold": 45, "home": 0, "hood": [22, 25, 27, 37, 38, 40, 43, 51], "how": [7, 12, 24, 27, 28, 37, 50, 51], "howev": [31, 46], "html": [7, 19], "http": [0, 26, 27, 29, 31, 47, 48, 49, 50], "hubblenet": 47, "human": 49, "hypothesi": [37, 51], "i": [0, 1, 4, 8, 13, 16, 19, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 36, 37, 38, 39, 41, 44, 45, 49, 50, 51], "id": [7, 13, 29, 44], "ideal": [39, 41], "ident": [0, 49], "identifi": [4, 25, 28, 29], "iex": 50, "ignor": [0, 7, 13, 51], "ignore_warn": 2, "import": [0, 22, 25, 26, 27, 28, 32, 39, 41, 43, 44, 45, 51], "importantli": 22, "impreson": 41, "includ": [27, 38, 39, 43], "incredibli": 31, "increment": [25, 32, 34, 37, 42, 51], "inform": [6, 7, 12, 31, 38, 39, 40, 48, 50, 52], "init": [24, 32, 49, 50, 51, 52], "initi": [22, 39, 49], "inject": [22, 24, 50], "insensit": [7, 19], "insid": 51, "insist": 46, "inspect": [44, 49, 52], "inspect_typ": [7, 15], "instal": [49, 51, 52], "instanc": [4, 30], "instantiate_contract": 4, "instantli": [7, 19], "instead": [26, 28, 33, 36, 50], "instruct": 50, "int": [1, 4, 5], "integr": [7, 12, 25], "intellig": 49, "intent": 38, "interact": [0, 7, 10, 25, 34, 35, 49], "interfac": [27, 28], "intern": [7, 19], "introduct": 28, "io": [0, 47], "ir": [7, 15], "irm": 50, "is_fork": [0, 4, 29, 31], "is_local_or_forked_network": 4, "is_matching_boa": 4, "is_zksync": [0, 4, 7, 8, 29, 30, 31, 32, 53], "issu": 28, "item": [37, 51], "iv": 44, "javascript": 50, "json": [0, 7, 12, 13, 14, 19, 20, 27, 44, 49], "just": [24, 26, 27, 28, 31, 33, 39, 49, 50, 51, 53], "k": [7, 19], "kava": 47, "kavascan": 47, "kcc": 47, "kdf": 44, "kdfparam": 44, "keep": [1, 25, 46], "kei": [0, 1, 3, 7, 10, 11, 13, 18, 19, 20, 27, 29, 34, 36, 52], "keystor": [0, 7, 10, 11, 18, 19, 20, 34, 36, 44, 45], "keystore_file_nam": [7, 20], "keystore_path": 2, "keystore_path_or_account_nam": 2, "keyword": [7, 19], "kind": 34, "know": [22, 27, 28, 53], "kucoin": 47, "kwarg": [1, 4, 5], "l": 44, "languag": 49, "last": [7, 19, 28, 32], "later": 50, "latest": [7, 16, 25], "layout": [7, 15, 26, 52], "lazi": 31, "lcov": [7, 19], "learn": [26, 27, 34], "least": [28, 50], "less": [7, 19], "let": [22, 24, 27, 28, 29, 34, 42, 48, 51], "level": [7, 12], "lf": [7, 19], "lib": [0, 22, 23], "lib_fold": 1, "licens": [25, 28], "life": 48, "like": [0, 4, 7, 14, 22, 26, 31, 32, 34, 36, 37, 38, 40, 48, 49, 50, 51, 53], "limit": [4, 7, 12], "line": [7, 13, 19, 26, 29, 31, 32, 46, 51], "linea": 47, "linux": [49, 50], "lisk": 47, "list": [1, 4, 26, 29, 34, 44], "live": [0, 7, 10, 11, 12, 18, 19, 31, 34, 36, 42], "live_or_stag": [0, 4, 30, 31, 32, 42], "ll": [1, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 38, 50, 51, 53], "llvm": 53, "load": [7, 19, 29, 31, 35], "load_config_from_root": 1, "local": [0, 25, 27, 28, 30, 31, 32, 51, 53], "localaccount": 2, "locally_running_chain": 28, "locat": [0, 7, 10, 11, 12, 13, 18, 19, 29, 33, 45], "long": [25, 31], "look": [0, 7, 14, 22, 25, 26, 27, 28, 32, 34, 42, 51], "lot": [27, 42, 51, 53], "lssf": 50, "lyra": 47, "m": [7, 19, 24, 50], "mac": 44, "machin": [49, 50], "maco": [49, 50, 51], "magic": [25, 28, 31], "mai": [7, 13, 19, 25, 46, 50, 51], "main": [0, 1, 47], "mainifest_contract": 27, "mainnet": [27, 28, 47], "mainnet_url": 28, "major": 27, "make": [7, 10, 11, 12, 18, 19, 25, 26, 28, 34, 36, 42, 45, 48, 50, 51], "manag": [7, 20, 33, 44, 49, 50, 51], "manifest": [27, 52], "manifest_contract": [4, 25, 27, 28], "manta": 47, "mantl": 47, "mark": [0, 7, 19, 42], "mark1": [7, 19], "mark2": [7, 19], "markdown": [33, 51], "marker": [37, 52], "match": [7, 12, 19, 25], "max": 40, "mayb": 42, "md": [7, 14, 26, 33, 34, 51], "mean": [21, 22, 32, 40], "median": 40, "memori": 4, "merge_config": 1, "mess": 31, "messag": [34, 36, 44, 49], "method": [7, 15, 19, 24, 45], "meti": 47, "might": 45, "milkomeda": 47, "min": 40, "miniaml": 22, "minim": [32, 51], "minut": [49, 50], "miss": [7, 19, 38], "mit": [25, 28], "mocasin": [44, 52], "moccasin": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 48, 51, 53], "moccasin_account": 2, "moccasin_config_dict": 1, "moccasin_config_path": 1, "moccasin_default_fold": 0, "moccasin_keystore_path": 0, "moccasin_main": [25, 27, 28, 32, 48, 51], "moccasin_path": 1, "moccasin_verifi": 4, "moccasinaccount": [4, 6, 52], "mock": 38, "mock_deploy": [28, 38, 39], "mockv3aggreg": 38, "mode": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 36, 44, 49], "modul": 35, "more": [4, 25, 26, 27, 34, 38, 39, 40, 43, 49, 50], "most": [21, 25, 27, 37, 39, 49], "mostli": [7, 19], "mox": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 27, 28, 32, 34, 35, 36, 37, 38, 40, 42, 44, 45, 46, 48, 50, 51, 53], "mt": 22, "much": [7, 12, 46], "multi": [7, 19], "multicall2": 47, "multipl": 39, "mutual": 4, "my": [25, 28], "my_account": [2, 44], "my_data": 0, "my_kei": 26, "my_network": 48, "my_project": 51, "my_script": 29, "my_token": 22, "my_token_dapp": 22, "n": 44, "name": [0, 4, 15, 26, 28, 29, 33, 34, 36, 38, 39, 40, 42, 48, 49, 52], "name_of_network_or_network": 5, "name_url_or_id": 1, "named_contract": [3, 4, 27], "namedcontract": [4, 6, 27, 28, 36, 39, 52], "nativ": [7, 13, 43, 53], "natspec": [7, 15], "need": [0, 21, 24, 26, 27, 28, 31, 49, 50, 51, 53], "neon": 47, "nested_tomlkit_upd": 1, "network": [0, 1, 5, 6, 7, 8, 10, 11, 12, 13, 18, 19, 25, 26, 27, 36, 39, 45, 48, 49, 51, 52], "network_name_or_id": 5, "networkenv": 4, "never": [0, 29, 50, 51], "new": [1, 14, 44, 49, 50], "new_numb": 25, "next": 28, "node": [7, 15, 31], "non": [0, 31], "none": [1, 2, 3, 4, 7, 19, 39, 48], "nonetyp": 4, "normal": [22, 26, 42], "note": 0, "notic": [29, 32, 38], "nova": 47, "novanetwork": 47, "now": [25, 27, 49, 51], "npx": 50, "number": [7, 12, 25, 27, 32, 34, 37, 42, 49, 51], "oasi": 47, "object": [0, 1, 3, 4, 5, 25, 49], "often": 25, "ok": [0, 42], "old": 1, "omax": 47, "omaxscan": 47, "onc": [44, 50], "one": [0, 7, 19, 27, 30, 39, 49], "ones": 1, "onli": [7, 12, 13, 19, 22, 24, 25, 28, 31, 32, 42, 48], "onu": 47, "onuschain": 47, "open": 51, "oper": 39, "optim": 47, "option": [1, 7, 8, 13, 16, 19, 25, 26, 29, 34, 36, 44, 49, 50], "oracl": 42, "order": [28, 30], "org": [22, 23, 47], "organ": [7, 16], "origin": 32, "other": [3, 22, 25, 27, 41, 42, 50, 51, 53], "other_data": 26, "otherwis": [1, 3], "our": [24, 26, 27, 28, 29, 42, 51], "out": [0, 7, 8, 27, 33, 48, 51], "out_fold": 1, "outcom": 31, "output": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 27, 32, 34, 36, 37, 38, 40, 44, 49, 50, 51], "over": [26, 49, 50], "overrid": [0, 26], "overriden": 4, "overview": 52, "overwrit": [1, 7, 14], "ow": 22, "own": [7, 10, 16, 34, 49, 50], "ownabl": 22, "p": [7, 20, 44], "pacif": 47, "packag": [7, 16, 17, 22, 34, 50, 51], "package_nam": 23, "page": [29, 48], "panda": [24, 50], "paramet": [26, 27, 28, 29, 52], "parent": [7, 19], "part": [22, 31], "pass": [4, 26, 29, 33, 37, 45, 46, 51], "password": [0, 2, 7, 10, 11, 18, 19, 20, 29, 34, 36, 44, 45], "password_fil": [7, 20], "password_file_path": [2, 7, 10, 11, 18, 19, 20, 34, 36], "path": [0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 18, 19, 20, 22, 27, 29, 34, 36, 40, 51], "pathlib": [3, 4], "patrick": 37, "payabl": 22, "pcaversaccio": [0, 7, 16, 22], "pdb": [7, 19], "peopl": 31, "per": [7, 19], "pip": [0, 7, 16, 17], "pipelin": 28, "place": [25, 26, 39], "plai": 42, "plain": [0, 29, 46], "plan": 49, "platform": [37, 38, 51], "pleas": 50, "pluggi": [37, 51], "plugin": [7, 19, 37, 51], "poetri": 24, "point": 1, "polygon": 47, "popular": 49, "portabl": 28, "posit": [34, 36, 44, 49], "possibl": [7, 13, 15, 20], "potenti": 28, "power": [22, 27, 39, 49], "powershel": 50, "pragma": [25, 28, 33], "prank": [37, 52], "preced": 26, "predict": 39, "prefer": [45, 50], "prefix": 45, "prepar": [7, 8], "prepend": 26, "press": 35, "pretend": [31, 41], "pretti": 27, "price_fe": 39, "print": [7, 12, 19, 20, 26, 27, 28, 32, 34, 41, 48, 51], "print_contract_address": 27, "prior": 50, "privat": [0, 7, 10, 11, 18, 19, 20, 29, 34, 36, 52], "private_kei": [2, 7, 10, 11, 18, 19, 34, 36], "probabl": 50, "process": [27, 31], "profil": [7, 19, 37, 38, 52], "project": [0, 1, 7, 8, 10, 11, 12, 14, 16, 18, 19, 22, 23, 26, 27, 28, 32, 34, 38, 49, 52], "project_root": 1, "prompt": [0, 7, 10, 11, 12, 18, 19, 34, 36, 44, 45], "prompt_even_if_unlock": 2, "prompt_liv": [0, 4, 7, 10, 11, 12, 18, 19, 30, 31, 32, 34, 36], "properti": [1, 2, 4], "provid": [0, 7, 13, 16, 39], "ps1": 50, "public": [2, 25, 27, 28, 33, 45], "publicnod": [0, 26, 27, 29, 31], "pull": [7, 13], "purg": [22, 49, 52], "push": 29, "put": [0, 26, 33], "py": [0, 7, 14, 18, 27, 28, 34, 36, 37, 38, 39, 48, 51, 53], "pyevm": [0, 4, 25, 28, 29, 30, 42, 51, 52], "pypi": [7, 16], "pyproject": [1, 7, 14, 37], "pyproject_config_dict": 1, "pyproject_config_path": 1, "pyproject_path": 1, "pytest": [0, 7, 19, 28, 37, 38, 39, 42, 51], "python": [7, 10, 16, 19, 22, 26, 33, 34, 35, 37, 38, 49, 50, 51, 52], "q": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 35, 36, 44, 49], "quad_manifest": 38, "quick": 42, "quickli": 51, "quickstart": [50, 52], "quiet": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 36, 44, 49], "r": 44, "random": [7, 20, 44], "raw": [1, 7, 12, 27], "re": [24, 42, 50], "read": [1, 25, 27, 28, 39], "read_config": 1, "read_configs_preserve_com": 1, "read_moccasin_config": 1, "read_moccasin_toml": 1, "read_moccasin_toml_preserve_com": 1, "read_pyproject_config": 1, "read_pyproject_toml": 1, "read_pyproject_toml_preserve_com": 1, "readm": [7, 14, 26, 33, 34, 51], "real": 31, "realli": 31, "recent": 25, "recogn": 27, "recommend": [24, 39, 49, 50], "refer": 34, "reflect": 33, "regular": [7, 16, 34, 37], "reinstal": 24, "rememb": [24, 26], "remov": [7, 19, 22, 52], "renam": 39, "replac": 0, "repo": [22, 23], "report": [7, 19], "repositori": [7, 16, 22], "request": 39, "request_fixtur": 39, "requir": [7, 16, 26, 50, 53], "rerun": [7, 19], "reset": [7, 19], "resourc": 39, "respect": [26, 34], "respons": 53, "restart": 50, "result": [27, 48], "retreiv": [7, 13], "return": [4, 7, 12, 13, 25, 27, 28, 32, 34, 39, 51], "reya": 47, "right": [33, 49, 53], "risk": [7, 10, 49], "rollux": 47, "root": 1, "root_path": 1, "rootdir": [37, 51], "roughli": [39, 50], "rpc": [0, 7, 10, 11, 12, 18, 19, 26, 27, 29, 31, 34, 36], "rst": 28, "run": [0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 34, 36, 37, 38, 40, 44, 45, 46, 49, 50, 52, 53], "runtim": [7, 15], "sai": [24, 28, 29, 34, 42, 48], "salt": 44, "same": [22, 26, 27, 34, 39, 42, 43], "saniti": 42, "sanko": 47, "save": [0, 7, 10, 11, 12, 13, 18, 19, 20, 25, 29, 32], "save_abi_path": [0, 4, 7, 13], "save_to_db": [0, 4, 7, 10, 11, 12, 18, 19, 25, 29, 30, 31, 32], "scaffold": 53, "scan": 47, "scope": 39, "script": [0, 10, 11, 12, 14, 18, 19, 22, 25, 26, 27, 29, 30, 31, 32, 33, 36, 38, 39, 44, 45, 46, 49, 50, 51, 52, 53], "script_fold": 1, "script_name_or_path": [7, 18, 34], "scroll": 47, "scrypt": 44, "search": 22, "second": 28, "second_mainnet": 28, "section": [0, 26, 49, 50], "see": [22, 26, 29, 34, 38, 40, 42, 48, 50, 51, 53], "select": 38, "selector": [7, 15], "self": [25, 28], "send": [0, 31], "separ": 28, "sepolia": [0, 26, 28, 29, 31, 34, 42, 47, 48, 49, 53], "sepolia_url": 28, "sepolia_zksync_rpc_url": 53, "session": [37, 39, 51], "set": [0, 1, 7, 13, 14, 19, 25, 26, 27, 28, 29, 38, 39, 42, 45, 50], "set_active_network": [1, 5], "set_boa_eoa": 4, "set_default": 3, "set_keystore_path": 2, "set_kwarg": 4, "set_numb": 25, "setup": [24, 28, 30, 31, 37, 38, 39, 42, 50], "sh": 50, "shell": [7, 10, 24, 35, 49], "shiden": 47, "shimmer": 47, "shimmer_evm": 47, "ship": 50, "shortcut": [7, 19], "shorthand": [7, 19, 27], "should": [31, 42], "show": [7, 19, 34, 36, 44, 49], "signatur": [7, 15], "similar": [36, 50], "similarli": 26, "simul": [28, 31, 32, 51, 53], "sinc": [25, 29], "singl": 28, "skip": [7, 19, 51], "smart": [7, 22, 25, 27, 28, 33, 34, 49, 51], "snekmat": [0, 7, 16, 22, 26], "so": [1, 7, 19, 25, 26, 27, 28, 32, 35, 37, 45, 49, 50], "some": [28, 29, 31, 42, 48, 49, 50], "some_data": 29, "some_environment_vari": 29, "some_valu": 33, "someth": 28, "soon": 27, "sourc": [7, 12, 19, 24, 26, 27], "spdx": [25, 28], "special": [0, 28, 32, 34], "specif": [0, 7, 8, 14, 31, 36], "specifi": [7, 19, 28, 32], "spin": [30, 53], "sqlite3": 25, "src": [0, 7, 8, 14, 15, 22, 26, 27, 33, 49, 51], "src_folder": 1, "stage": [0, 37, 52], "stai": 49, "stand": [49, 50], "start": [7, 19, 27, 30, 32, 34, 35, 37, 49, 51], "start_path": 1, "state": 39, "static": [1, 4], "stdev": 40, "step": 50, "still": 28, "stmt": 38, "storag": [7, 15], "store": [0, 44], "str": [1, 2, 3, 4, 5], "string": [4, 7, 16, 17, 27], "structur": [7, 14, 33, 51], "style": 0, "substr": [7, 19], "subsystem": [49, 50], "successfulli": 51, "suit": 42, "summari": [7, 19], "support": [0, 7, 13, 30, 48, 53], "suppress": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 34, 36, 44, 49], "sure": [7, 10, 11, 12, 18, 19, 28, 29, 30, 34, 36, 42], "sy": [7, 19], "sync": 50, "syntax": [22, 43], "syscoin": 47, "system": [49, 53], "t": [0, 7, 13, 19, 24, 25, 26, 27, 28, 29, 31, 32, 42, 44, 50], "tab": 50, "taiko": 47, "take": [28, 31], "target": [7, 19], "technic": 27, "tee": [7, 19], "tell": 51, "temporari": 39, "term": [7, 19], "termin": 50, "test": [0, 4, 8, 14, 27, 28, 31, 33, 34, 38, 39, 40, 41, 47, 49, 52], "test_count": [7, 14, 34, 37, 51], "test_fold": 1, "test_fork_usdc": 37, "test_increment_on": 37, "test_increment_two": 37, "test_method": [7, 19], "test_normal_test": 42, "test_oth": [7, 19], "test_staging_test": 42, "test_using_fixtur": 39, "testnet": [28, 47], "text": [0, 29, 46], "than": [7, 19], "thei": [0, 7, 10, 11, 12, 18, 19, 22, 25, 27, 34, 36, 39, 53], "them": [0, 7, 19, 25, 33, 34, 45, 46, 50, 53], "therefor": 53, "thi": [0, 1, 2, 4, 7, 8, 10, 11, 12, 13, 14, 15, 18, 19, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 44, 45, 49, 50, 51], "thing": [27, 50, 53], "think": [0, 49], "those": [7, 19, 50], "through": 29, "thundercor": 47, "time": 25, "titanoboa": [30, 32, 33, 37, 38, 40, 48, 49, 51], "todai": [48, 53], "token": 22, "toml": [1, 4, 7, 8, 10, 11, 12, 13, 14, 18, 19, 21, 22, 23, 25, 27, 28, 29, 33, 34, 36, 37, 38, 42, 44, 45, 48, 51, 52], "toml_data": [1, 5], "tomldocu": 1, "tool": [6, 22, 26, 27, 48, 50], "top": 28, "total": [7, 19, 38], "touch": 26, "trace": [7, 19], "traceback": [7, 19], "track": 25, "tradit": 50, "tradition": 28, "transact": [0, 31], "tree": 51, "trick": 42, "true": [0, 1, 4, 5, 22, 25, 27, 29, 30, 31, 39, 42, 53], "trust": 31, "tune": 49, "tutori": [49, 50], "tweak": 26, "two": [28, 30, 34, 42], "type": [4, 7, 15, 19], "typic": [27, 33], "u": [27, 28, 49, 50], "ugli": 27, "uglier": 27, "uint256": [25, 28, 40], "under": [7, 19, 22, 25, 27, 37, 38, 40, 43, 49, 51], "understand": [49, 50], "unfamiliar": 50, "union": 4, "unless": 42, "unlik": 51, "unlock": [0, 2, 7, 10, 11, 18, 19, 29, 34, 36], "unrel": 26, "unsaf": 45, "unsafe_password_fil": [0, 4, 29], "up": [1, 26, 27, 30, 39, 51, 53], "updat": 33, "update_from_deployed_contract": 3, "updraft": 27, "uri": [7, 13], "url": [0, 4, 7, 10, 11, 12, 18, 19, 26, 27, 28, 29, 31, 34, 36, 49, 53], "us": [0, 4, 7, 8, 10, 11, 13, 15, 18, 19, 22, 23, 24, 26, 27, 28, 29, 32, 33, 34, 36, 37, 38, 40, 41, 43, 44, 45, 48, 49, 50, 51], "usag": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 34, 36, 40, 44, 49], "usdc": [0, 27, 28, 36, 39], "user": [0, 7, 10, 11, 12, 16, 18, 19, 25, 34, 36, 37, 50, 51], "util": [20, 44, 49], "utils_command": 7, "v0": 50, "v1": 53, "valu": [0, 1, 7, 13, 19, 26], "variabl": [7, 13, 27, 39], "ve": [4, 25, 50, 51], "vela": 47, "venom": [7, 15], "venv": [24, 50], "veri": [28, 36], "verif": [49, 52], "verifi": [4, 48, 50, 53], "verificationresult": 4, "version": [7, 16, 22, 25, 26, 27, 28, 33, 44, 50, 53], "via": [29, 31, 46, 50], "view": [9, 12, 44, 49], "virtual": 51, "vscode": [7, 14, 51], "vy": [0, 7, 8, 14, 15, 25, 27, 28, 34, 38, 51], "vyi": 27, "vyper": [0, 3, 7, 8, 15, 22, 27, 51, 53], "vyper_contract": 3, "vyper_deploy": 3, "vypercontract": [1, 3, 4, 5, 27, 28, 32], "vyperdeploy": [3, 4], "wa": 27, "wai": [4, 7, 19, 25, 28, 34, 41, 49, 50], "wait_for_verif": 48, "walk": 29, "wallet": [21, 29, 45, 49, 52], "wallet_command": [7, 20], "want": [0, 7, 10, 11, 12, 13, 15, 18, 19, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 36, 39, 44, 45, 50, 51], "warn": [7, 19], "watch": [49, 50], "we": [24, 25, 26, 27, 28, 29, 31, 32, 39, 42, 48, 49, 50, 51], "web3": 49, "weird": 50, "well": [7, 19, 42, 50], "what": [27, 28, 48], "whatev": [0, 26], "when": [0, 24, 25, 27, 28, 29, 30, 31, 32, 45], "whenev": 26, "where": [7, 16, 19, 26, 28, 31, 33, 42, 50], "which": [7, 14, 19, 22, 25, 26, 27, 36, 51], "while": [7, 19, 31], "whole": [31, 32], "whose": [7, 19], "window": [49, 50], "wish": [1, 33, 50], "without": [22, 25, 36], "work": [7, 10, 11, 12, 13, 18, 19, 22, 24, 25, 27, 28, 29, 30, 36, 45, 49, 50, 51, 52, 53], "world": 31, "would": [22, 26, 27, 29, 31, 34, 53], "wrapper": [1, 4, 48], "write": [1, 28], "write_depend": 1, "written": [49, 50], "wsl": [49, 50], "x": [7, 19, 40], "xml": [7, 19], "xxx": 45, "xyz": 47, "yet": 53, "you": [0, 1, 4, 6, 7, 10, 11, 12, 13, 14, 15, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 53], "your": [0, 4, 7, 8, 10, 11, 12, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 49, 50, 51], "your_api_kei": 0, "yourself": 32, "zetachain": 47, "zkevm": 47, "zksync": [0, 29, 30, 45, 47, 48, 49, 52], "zksync2": 47, "zksynccontract": [1, 4, 5], "zksyncdeploy": 4, "zksyncenv": 4, "zksyncexplor": [47, 48], "zkvyper": 53, "zkync": 53, "zora": 47}, "titles": ["All moccasin toml parameters", "Config", "MoccasinAccount", "NamedContract", "Network", "_Networks", "Classes Reference", "CLI Command Reference", "compile", "config", "console", "deploy", "deployments", "explorer", "init", "inspect", "install", "purge", "run", "test", "wallet", "Common Errors", "Dependencies", "Removing Dependencies (Purge)", "Python packages in your scripts", "Deployments", "moccasin.toml", "Named Contracts", "Manifest Contract (get_or_deploy_contract)", "Networks", "eravm", "Forked Networks", "pyevm", "Project Layout", "Scripting", "Console", "Deploy", "Testing", "Coverage", "Fixtures", "Gas Profiling", "Pranking", "Staging Markers", "Titanoboa Testing", "Wallet", "Configurating Keys", "Private Keys", "Explorer and Network Default Information", "Contract Verification", "Moccasin", "Installing Moccasin", "Quickstart", "Moccasin", "Getting started with ZKsync"], "titleterms": {"0xxxxxxxxxx": 21, "1": [48, 53], "2": 48, "3": 48, "In": 24, "Of": 26, "The": 42, "_network": 5, "add": [7, 20, 24, 48], "address": 7, "address_zero": 7, "after": 50, "all": 0, "also": 42, "an": 24, "ar": 39, "argument": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "boa": 21, "build": 7, "chang": 33, "check": 25, "class": 6, "cli": 7, "command": [7, 13, 20, 34], "common": 21, "compil": [7, 8, 33], "concept": 52, "config": [1, 7, 9], "configur": 45, "consol": [7, 10, 35], "contract": [25, 27, 28, 48, 51], "core": 52, "coverag": 38, "creat": 51, "d": [7, 20], "data": 26, "decrypt": [7, 20], "default": [30, 31, 32, 42, 47], "defin": 21, "delet": [7, 20], "depend": [22, 23, 34], "deploi": [7, 11, 36, 51], "deploy": [7, 12, 25, 53], "dk": [7, 20], "document": 49, "encrypt": 44, "environ": [0, 24, 50], "eoa": 21, "eravm": 30, "error": 21, "exampl": 27, "explor": [7, 13, 47, 48], "extra": 26, "fetch": [7, 13], "fixtu": 39, "fixtur": 39, "fork": 31, "format": [0, 49], "from": [34, 50], "g": [7, 20], "ga": 40, "gener": [7, 20], "get": [7, 13, 25, 52, 53], "get_or_deploy_contract": 28, "github": [22, 23], "guid": 52, "help": 34, "how": [42, 49, 52], "i": [7, 20, 31, 42], "idea": 42, "import": [7, 20, 34], "inform": 47, "init": [7, 14], "inspect": [7, 15], "instal": [7, 16, 22, 24, 50, 53], "interact": [27, 28], "isol": [24, 50], "kei": [44, 45, 46], "l": [7, 20], "layout": 33, "list": [7, 13, 20], "local": 42, "manifest": 28, "marker": 42, "minim": 27, "moccasin": [0, 26, 34, 49, 50, 52], "moccasin_main": 34, "moccasin_verifi": 48, "moccasinaccount": 2, "mox": [6, 7], "multipl": 28, "my": 42, "name": [7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 25, 27], "namedcontract": 3, "network": [4, 21, 28, 29, 30, 31, 32, 34, 42, 47, 53], "networkenv": 21, "new": [7, 20, 51], "object": 21, "one": 28, "oper": 26, "option": [0, 33], "order": 26, "packag": 24, "paramet": 0, "pip": [22, 23, 24, 50], "pipx": [24, 50], "posit": [7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "possibl": 0, "prank": 41, "prerequisit": 50, "privat": [44, 46], "profil": 40, "project": [33, 51], "purg": [7, 17, 23], "pyevm": 32, "pypi": [22, 23], "pyproject": 26, "python": 24, "quickstart": 51, "read": 49, "refer": [6, 7, 52], "remov": 23, "run": [7, 18, 30, 42, 48, 51], "script": [7, 24, 28, 34, 48], "setup": [48, 53], "sourc": 50, "src": 34, "stage": 42, "start": [52, 53], "sub": [7, 13, 20], "test": [7, 19, 37, 42, 43, 51, 53], "titanoboa": 43, "toml": [0, 26, 49], "tool": 24, "tutori": 52, "u": 7, "uncheck": 25, "us": [39, 42], "util": 7, "uv": [22, 24, 50], "v": 25, "valueerror": 21, "variabl": 0, "verif": 48, "view": [7, 20], "virtual": [24, 50], "vyper": 33, "wallet": [7, 20, 44], "want": 42, "what": [31, 39, 42], "why": 49, "work": [34, 42], "your": [24, 33, 48, 53], "zero": 7, "zero_address": 7, "zksync": 53}}) \ No newline at end of file diff --git a/toctree.html b/toctree.html new file mode 100644 index 0000000..0fba11b --- /dev/null +++ b/toctree.html @@ -0,0 +1,358 @@ + + + + + moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/tutorials/zksync-getting-started.html b/tutorials/zksync-getting-started.html new file mode 100644 index 0000000..7328897 --- /dev/null +++ b/tutorials/zksync-getting-started.html @@ -0,0 +1,319 @@ + + + + + Getting started with ZKsync - moccasin documentation + + + + + + + + + + + + +
+
+
+ + + + moccasin + +
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+

Getting started with ZKsync

+
+

Installation

+

To get started with ZKsync on moccasin, you’ll need the following:

+
    +
  • era_test_node

    +
      +
    • You’ll know you did it right if you can run era_test_node --version and you see a response like era_test_node 0.1.0 (a178051e8 2024-09-07)

    • +
    +
  • +
  • era-compiler-vyper

    +
      +
    • You’ll know you did it right if you can run zkvyper --version and you see a response like Vyper compiler for ZKync v1.5.4 (LLVM build f9f732c8ebdb88fb8cd4528482a00e4f65bcb8b7)

    • +
    +
  • +
+
+
+

Testing

+

To test on a local zksync network, run the following:

+
mox test --network eravm
+
+
+

And you’ll spin up a local zksync network, and run your tests on it! You can then deploy, test, and verify contracts as you would any other network.

+
+

Note

+

As of today, moccasin does not support “system contracts” or “simulations”, therefore, testing things like native account abstraction are not yet supported. You can “do” them, but they will require custom scaffolding.

+
+
+
+

Deployment

+

To deploy to a zksync network, you have to do a lot of work.

+
+
+

1. Setup your network

+
[networks.sepolia-zksync]
+url = "$SEPOLIA_ZKSYNC_RPC_URL"
+is_zksync = true
+
+
+
    +
  1. Run your script

  2. +
+
mox run deploy.py --network sepolia-zksync
+
+
+

That’s it! moccasin can handle ZKsync networks just like any other network.

+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file