apeworx / ape-starknet Goto Github PK
View Code? Open in Web Editor NEWStarkNet ecosystem plugin for the Ape Framework
Home Page: https://www.apeworx.io/
License: Apache License 2.0
StarkNet ecosystem plugin for the Ape Framework
Home Page: https://www.apeworx.io/
License: Apache License 2.0
Support the --load-path LOAD_PATH
flag argument in the starknet-devnet
subprocess for local
network.
starknet: local: state: path/to/file
and have it always use that state when starting.provider_settings
kwarg to allow loading the starknet devnet provider from a state.provider.update_settings()
with new state, the process gets restarted with that new state.Include links to any open issues that must be resolved before this feature can be implemented.
Support the set_timestamp()
API method in the Starknet provider!
Here is the example in hardhat:
https://github.com/ApeWorX/ape-hardhat/blob/main/ape_hardhat/providers.py#L306-L309
Here is the RPC documentation: https://github.com/Shard-Labs/starknet-devnet#set-time
I am not sure!
Include links to any open issues that must be resolved before this feature can be implemented.
ape
and plugin versions:$ ape --version
# 0.4.0
$ ape plugins list
# Installed Plugins:
starknet 0.4.0a0
solidity 0.4.0
hardhat 0.4.0
cairo 0.4.0a0
Please include information like:
When provider.declare()
command is used ServerDisconnectedError: Server disconnected
error is received. If I use declare for different contract with lesser LOC, there is no problem. Timeout default value should be increased for contracts with high loc.
def declare(name: str) -> int:
project = ape.project.get_contract(contract)
return project.provider.declare(project).class_hash
Output:
self = <aiohttp.client_proto.ResponseHandler object at 0x7f30ca3b42e0>
async def read(self) -> _T:
if not self._buffer and not self._eof:
assert not self._waiter
self._waiter = self._loop.create_future()
try:
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
../../.cache/pypoetry/virtualenvs/sithswap-jcoMElJJ-py3.9/lib/python3.9/site-packages/aiohttp/streams.py:616: ServerDisconnectedError
INFO starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:37:25 +0300] [28700] [INFO] 127.0.0.1 - - [22/Aug/2022:11:37:25 +0300] "GET / HTTP/1.1" 404 232 "-" "Python-urllib/3.9"\n'
INFO starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:37:38 +0300] [28700] [INFO] 127.0.0.1 - - [22/Aug/2022:11:37:38 +0300] "GET / HTTP/1.1" 404 232 "-" "Python-urllib/3.9"\n'
INFO starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:38:10 +0300] [28647] [CRITICAL] WORKER TIMEOUT (pid:28700)\n'
INFO starknet_stdout_subprocessProviderLogger:providers.py:1054 * Listening on http://127.0.0.1:8545/ (Press CTRL+C to quit)
===================================================== short test summary info =====================================================
ERROR tests/cairo/test_SithSwapV1Factory.py::test_factory - aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Fill this in if you have ideas on how the bug could be fixed.
Get the output from the starknet-devnet process and put it somewhere
.ape/starknet/provider/stdout.logs
)Might be a way to use Popen
Might need to update core ape: https://github.com/ApeWorX/ape/blob/main/src/ape/api/providers.py#L1021
If you spend ages deploying an account and mess up or accidentally close out of the part with the password prompt, the account was just deployed for no reason. This could be bad!
It is safer and more async!
Include links to any open issues that must be resolved before this feature can be implemented.
Looking at the latest CI run, I can read the the installed ape-starknet
version is 0.1.dev1+gf849c33-
.
Here are revelant logs:
Building wheels for collected packages: starknet.py, ape-starknet
# (...)
Building wheel for ape-starknet (pyproject.toml): started
Building wheel for ape-starknet (pyproject.toml): finished with status 'done'
Created wheel for ape-starknet: filename=ape_starknet-0.1.dev1+gf849c33-py3-none-any.whl size=33633 sha256=8728d8ff2469eeecfae43c74eb4e255a1bc392d315bb3d4c13a93731595af0b2
Stored in directory: /home/runner/.cache/pip/wheels/6e/5e/74/d0e00c28c149775ac95ac0aa8f31b4a1c2c3596935addaa008
Successfully built starknet.py ape-starknet
There are lots of type: ignore
comments in imports.
Would you be interested in a PR to create the mypy configuration file to skip that specific check?
Here is the minimal mypy.ini
file:
[mypy]
ignore_missing_imports = true
And a complete example (my preference):
[mypy]
# Ensure we know what we do
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
# warn_unreachable = true (to check)
# Imports management
ignore_missing_imports = true
follow_imports = normal
None.
Show how to do L1 <> L2 communication using plugin
send_message_to_l1()
. Go through the full flow to get the message consumed.Lib tools to use: https://starknetpy.readthedocs.io/en/latest/messages.html
Understanding of the flow: https://www.slideshare.net/TinaBregovi/starknet-l1l2-messaging-workshop
ape
and plugin versions:$ ape --version
0.3.4
$ ape plugins list
Installed Plugins:
cairo 0.3.0a1
starknet commit 573ffec279b513154a2240e8cae9720f082c1309
Transaction event logs are not accurate regarding 2 aspects.
The code demonstrating issues can be found on PR #49 to ease the process.
For the next lines, let's say we have such a receipt (it's the one from the token_contract.transfer(...)
PR call):
receipt = {
"contract_address": "0x689B5912B28116e838e391ad6fAA2b6B739006691aA78373d96dB4AE310cfE3",
"block_number": 1,
"data": b"",
"events": [
{
"from_address": 3168006825980949969250163460867888544633008708955342843088143995484769986594,
"keys": [271746229759260285552388728919865295615886751538523744128730118297934206697],
"data": [
2957188269200184411255999937111091253445605066208535325081986593780030033891,
593601037788204467271687388622907973095701257945468643371780138908223826245,
10,
0,
],
},
{
"from_address": 3168006825980949969250163460867888544633008708955342843088143995484769986594,
"keys": [1495344490136071460114920061035658809061971367051424659723723519153313545494],
"data": [
2957188269200184411255999937111091253445605066208535325081986593780030033891,
1000000000000000000000,
0,
10,
0,
593601037788204467271687388622907973095701257945468643371780138908223826245,
],
},
],
"required_confirmations": 0,
"status": 4,
"transaction_hash": "0x049d789622108a9358e7971cecac6c2ac804af74c64a427c72fe9ac0ffd90fc9",
"value": 0,
"type": 3,
"block_hash": "0x042f3bcd0af625683b06c9da4614865b71cd5462e4e5ededbde8a182af75e9e0",
"actual_fee": 0,
"entry_point_selector": 617075754465154585683856897856256838130216341506379215893724690153393808813,
"max_fee": 0,
"return_value": 1,
}
And we want to get all Transfer
logs from that receipt:
logs = list(receipt.decode_logs(token_contract.Transfer))
Let's display event arguments:
>>> for idx, log in enumerate(logs, 1):
... print(idx, log.event_arguments)
1 {'from_': 2957188269200184411255999937111091253445605066208535325081986593780030033891, 'to': 593601037788204467271687388622907973095701257945468643371780138908223826245, 'value': 10}
2 {'from_': 2957188269200184411255999937111091253445605066208535325081986593780030033891, 'to': 1000000000000000000000, 'value': 0}
Transfer
log, we get 2 logs (Transfer
+ Mint
).Tuple[int, int]
).to
value for instance), and even the argument count is broken (Mint
has 4 arguments).Currently, we mimic the behavior to generate the pkeys from devnet
It would be more stable to use their /predeployedaccounts
endpoint: 0xSpaceShard/starknet-devnet#138
fixes: ape-45
Replace logic for generating pkeys for devnet accounts with API request to endpoint
Include links to any open issues that must be resolved before this feature can be implemented.
To better handles changes to fee token in devnet, use the /fee_token
request to capture the fee token addres.
Then, cache it to avoid subsequent requests.
fee_token
to DevnetClient
TokenManager
use that request to return the address of the fee token instead of the hardcoded one.Include links to any open issues that must be resolved before this feature can be implemented.
then we can delete the random _deploy()
helper that is in the provider because it is a bit confusing!
Also it would be great way to showcase the SDK feature some more and show how we can include it with a plugin.
Or maybe just import the contract type dict.
Include links to any open issues that must be resolved before this feature can be implemented.
Account __execute__method can handle multiple calls but the Receipt API currently struggles with that
Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!
Remember, your feature is much more likely to be included if it does not involve any breaking changes.
Include links to any open issues that must be resolved before this feature can be implemented.
When interacting with a contract that accepts structs as inputs, I am unable to properly provide the values
An example: use acc.transfer()
.. The result us a Uint256 struct. The failure causes transfer()
(and normal contract methods) to not work.
something something Starknet(EcosystemAPI).decode_calldata()
Issue to help following the bug resolution. That's a mandatory one for the next release.
It depends on:
When, we will have to adapt 2 tests (marked as xfail
).
Ape will not always see contracts that need re-compilation upon changes, this was noticed both in standalone compilation mode (single command) and also as part of ape-starknet
flow for running tests, furthermore, during the latter Ape will output that relevant contracts are being re-compiled however test behavior remains unchanged until the .pytest_cache
folder is deleted (signaling that Ape either A) did not correctly re-compile all contracts that needed to B) is still loading the old artifacts for running the test)
currently, "latest"
, "earliest"
and negative block numbers (start from the end) do not function!
provider.get_block("latest")
provider.get_block(-1)
Include links to any open issues that must be resolved before this feature can be implemented.
deploy()
API methods in Ape by making an InvokeFunctionTransaction
against the Universal Deployer ContractThe UDC contract method name is deployContract
.
You can see its implementation inputs here: https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/openzeppelin/utils/presets/UniversalDeployer.cairo#L29-L33
We should automatically craft an InvokeFunctionTransaction
using this method and expected call data.
The contract address of the UDC should be hardcoded or gathered from a library.
Include links to any open issues that must be resolved before this feature can be implemented.
Provide a simple overview of what you wish to see added. Please include:
Deploying a contract with sender address fails currently.
factory = project.deploy(1,2,sender=deployer)
AccountsError: Can only call Starknet invoke transactions
Allow to run protostar cairo tests along side ape to support diverse projects
You will likely have to copy, import, or adjust the test collector from the protostar package and have it work while also collecting the ape tests.
ape compile
fails after first compile completed with No content to fetch.
error.
ape
and plugin versions:$ ape --version
# `0.4.4`
$ ape plugins list
Installed Plugins:
starknet 0.4.0a0
cairo 0.4.0a0
solidity 0.4.0
hardhat 0.4.1
After ape compile
completed, other compile commands fails.
Please include information like:
* ape compile
Traceback (most recent call last):
File "/home/tevrat/cairo_venv/bin/ape", line 8, in <module>
sys.exit(cli())
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ape/_cli.py", line 40, in invoke
return super().invoke(ctx)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ape_compile/_cli.py", line 53, in cli
contract_types = cli_ctx.project_manager.load_contracts(
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ape/managers/project/manager.py", line 505, in load_contracts
manifest = self._project.create_manifest(file_paths, use_cache=use_cache)
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ape/managers/project/types.py", line 137, in create_manifest
needs_compiling = set(filter(does_need_compiling, source_paths))
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ape/managers/project/types.py", line 126, in does_need_compiling
cached_checksum = cached_source.calculate_checksum()
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ethpm_types/source.py", line 143, in calculate_checksum
content = self.fetch_content()
File "/home/tevrat/cairo_venv/lib/python3.9/site-packages/ethpm_types/source.py", line 109, in fetch_content
raise ValueError("No content to fetch.")
ValueError: No content to fetch.
Fill this in if you have ideas on how the bug could be fixed.
ape
and plugin versions:$ ape --version
0.5.1
$ ape plugins list
Installed Plugins:
starknet 0.5.0a0
cairo 0.5.0a0
$ pip freeze | ag ape-starknet
ape-starknet==0.5.0a0
In a brand new virtual environment, running Python 3.8.5, I installed ape-starknet
using pip install ape-starknet
and then installed the Cairo and StarkNet plugins with: ape plugins install starknet cairo
. The last command showed an error during execution:
WARNING: Ecosystem 'starknet' is not a registered ecosystem.
INFO: Installing starknet...
SUCCESS: Plugin 'starknet==0.5.0a0' has been installed.
INFO: Installing cairo...
ERROR: ape-starknet 0.5.0a0 has requirement starknet.py==0.6.0a0, but you'll have starknet-py 0.6.1a0 which is incompatible.
SUCCESS: Plugin 'cairo==0.5.0a0' has been installed.
but the plugin appears to be successfully installed according to the output and also ape plugins list
. I also noticed that there is no ape-cairo dependency inside the virtual environment following the installation of the plugin (not sure if that is an issue, but prior to this upgrade the package was installed):
$ pip freeze | ag ape
ape-starknet==0.5.0a0
eth-ape==0.5.1
Now, when I try to compile any Cairo smart contract, I get the following error:
$ ape compile contracts/Staking.cairo
INFO: Compiling 'Staking.cairo'.
Traceback (most recent call last):
File "/home/sancho/.pyenv/versions/3.8.5/bin/ape", line 8, in <module>
sys.exit(cli())
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape/_cli.py", line 40, in invoke
return super().invoke(ctx)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape_compile/_cli.py", line 53, in cli
contract_types = cli_ctx.project_manager.load_contracts(
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape/managers/project/manager.py", line 501, in load_contracts
manifest = self._project.create_manifest(file_paths, use_cache=use_cache)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape/managers/project/types.py", line 159, in create_manifest
compiled_contract_types = self.compiler_manager.compile(list(needs_compiling))
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape/managers/compilers.py", line 98, in compile
compiled_contracts = self.registered_compilers[extension].compile(
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/site-packages/ape_cairo/compiler.py", line 119, in compile
source = StarknetCompilationSource(str(contract_path))
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/typing.py", line 729, in __call__
result = self.__origin__(*args, **kwargs)
File "/home/sancho/.pyenv/versions/3.8.5/lib/python3.8/typing.py", line 339, in __call__
raise TypeError(f"Cannot instantiate {self!r}")
TypeError: Cannot instantiate typing.Union
The same contract compiles using starknet-compile
without errors.
Implement show_trace()
method on Receipts so that we can view pretty Starknet traces.
See this core-ape PR for Ethereum's flavor: https://github.com/ApeWorX/ape/pull/746/files
def show_trace():
# Fetch Starknet trace and display help info, such as calls, calldata, return data, call type
See the trace schema here: https://www.starknet.io/docs/0.10.0/hello_starknet/cli.html#get-transaction-trace
evm-trace
to support Starknet style traces.Won't release until this is fixed but it started happening once the latest cairo-lang got yanked.
When calling methods directly from their address on contracts that are proxies, things fail.
Example common proxy contracts in this ecosystem:
Both have issues on mainnet
regarding ABIs. The logic for InvokeTransaction
makes it difficult to use ABIs from the implementation address while invoking against the proxy address.
Discussions have been occurring with the starknet.py
team about this as well as we figure out what to do.
software-mansion/starknet.py#128
We all know Starknet is pretty slow currently.
Let's figure out way to optimize on our end to improve the experience.
Include links to any open issues that must be resolved before this feature can be implemented.
We are not successfully parsing array parameters and causing a failure from line https://github.com/ApeWorX/ape/blob/51744e26ba2d8880738966ab099973053536a168/src/ape/contracts/base.py#L138
Detect array params in decode_input
Support full node.
When the user specifies a URI that is not testnet
or mainnet
, have it use a FullnodeClient
from Starknet.py
instead of the GatewayClient
it uses currently.
The more challenging part here (with unknowns) is any potential differences that arise. Hopefully it is minimal in which case this a simple feature to support.
NOTE This will be needed for using Alchemy as a Starknet provider
Understanding of full node.
Review imports at the beginning of work.
Schema might be different vs the current returned value
Have an enum value for the class hash so users dont have to know it
Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!
Remember, your feature is much more likely to be included if it does not involve any breaking changes.
Include links to any open issues that must be resolved before this feature can be implemented.
Latest
If you have an external method with no arguments like this:
@external
func get_array{
syscall_ptr : felt*, pedersen_ptr : HashBuiltin*,
range_check_ptr}() -> (arr_len: felt, arr: felt*):
const ARRAY_SIZE = 3
let (ptr) = alloc()
assert [ptr] = 1
assert [ptr + 1] = 2
assert [ptr + 2] = 3
let (current_count) = array_get_counter.read()
array_get_counter.write(current_count + 1)
return (ARRAY_SIZE, ptr)
end
We are able unable to use an AccountClient
to make the call.
We get an error from sign_calldata()
(in Starknet.py
) because we are trying to sign empty calldata.
The error does not occur if the method is @view
instead of @external
and it does not call if you use the normal client instead of the account client (only works on Devnet)
As of https://github.com/ApeWorX/ape/pull/776/files, there is a new API method to implement in the provider that should get the transactions in a block.
What have I drafted so far:
provider.py
changes:
def get_transactions_by_block(self, block_id: HexBytes) -> Iterator[TransactionAPI]:
block = self._get_block(block_id)
for txn in block.transactions:
yield self.network.ecosystem.create_transaction(**txn)
Starknet
ecosystem API changes:
def create_transaction(self, **kwargs) -> TransactionAPI:
txn_type = kwargs.pop("type", kwargs.pop("tx_type"))
txn_cls: Union[Type[InvokeFunctionTransaction], Type[DeployTransaction]]
if txn_type == TransactionType.INVOKE_FUNCTION:
txn_cls = InvokeFunctionTransaction
elif txn_type == TransactionType.DEPLOY:
txn_cls = DeployTransaction
txn_data = {**kwargs}
if "max_fee" in txn_data and not isinstance(txn_data["max_fee"], int):
txn_data["max_fee"] = self.encode_primitive_value(txn_data["max_fee"])
if "signature" in txn_data and not isinstance(txn_data["signature"], TransactionSignature):
txn_data["signature"] = TransactionSignature(
v=0, r=HexBytes(txn_data["signature"][0]), s=HexBytes(txn_data["signature"][1])
)
# if "method_abi" not in txn_data:
# contract = self.chain_manager.contracts.get(txn_data["contract_address"])
return txn_cls(**txn_data)
I believe this will require ApeWorX/ape-cairo#20
Include links to any open issues that must be resolved before this feature can be implemented.
Support devnet lite mode
User's can update their settings:
ape-config.yaml
:starknet:
provider:
local:
lite_mode: True # Defaults to False
Network setting for local can be set to local
And then set the CLI flag accordingly.
Could also be set via provider settings
https://github.com/Shard-Labs/starknet-devnet/blob/master/README.md#lite-mode
Include links to any open issues that must be resolved before this feature can be implemented.
Block size is not being calculated correctly.
Please include information like:
Fill this in if you have ideas on how the bug could be fixed.
Plugin and Ape 0.5
Events defined in another contract does not show up in receipt.
TBD
Going to show how estimate gas works, noticed it was never getting called.
Bout to open A PR to fix this along with adding the explorer for betting proxy support
Currently, support for switching network providers "in-flight" during the execution of test code remains broken, e.g. within a test case, can't jump from interacting with a Hardhat VM contract to interacting with a (Starknet) Devnet contract, even when forcibly selecting the new provider, the previous one will still be used to interact with the Starknet network thereby failing the test run
I know we want to do this in Ape too, but maybe there is an easy way to do it in Starknet without waiting.
We want return values on receipts.
set_balance()
can be implemented in the devnet provider by doing this:
from starknet_devnet.state import state
tx_hash = await state.starknet_wrapper.fee_token.mint(
to_address=address, amount=amount
)
Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!
Remember, your feature is much more likely to be included if it does not involve any breaking changes.
Include links to any open issues that must be resolved before this feature can be implemented.
It is possible to estimate gas cost from the devnet since several versions now, maybe could we remove that condition block then?
ape-starknet/ape_starknet/provider.py
Lines 163 to 165 in 573ffec
I guess it would unlock part of our tests at SithSwap.
Note: I open an issue because I tried removing that code, and it broke all tests:
BadRequest: HTTP error ocurred. Status: 500. Text: {"message":"Error at pc=0:6:\nGot an exception while executing a hint.\nCairo traceback (most recent call last):\nUnknown location (pc=0:1324)\nUnknown location (pc=0:1301)\nUnknown location (pc=0:611)\nUnknown location (pc=0:889)\n\nTraceback (most recent call last):\n File \"<hint0>\", line 3, in <module>\nAssertionError: assert_not_zero failed: 0 = 0.","status_code":500}
Maybe opened PRs will help, especially #46? ๐ค
ape
and plugin versions:$ ape --version
# 0.6.26
$ ape plugins list
# Installed Plugins
cairo 0.6.1
starknet 0.6.0
Please include information like:
what command you ran
ape compile
the code that caused the failure (see this link for help with formatting code)
if source.content:
destination_path.parent.mkdir(parents=True, exist_ok=True)
destination_path.touch()
destination_path.write_text(source.content)
Traceback (most recent call last):
File "/Users/usesr/Downloads/shefcraft/venv/bin/ape", line 8, in <module>
sys.exit(cli())
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape/_cli.py", line 37, in invoke
return super().invoke(ctx)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape_compile/_cli.py", line 83, in cli
contract_types = cli_ctx.project_manager.load_contracts(
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape/managers/project/manager.py", line 668, in load_contracts
manifest = self.local_project.create_manifest(
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape/managers/project/types.py", line 179, in create_manifest
compiled_contract_types = self._compile(project_sources)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape/managers/project/types.py", line 211, in _compile
return self.compiler_manager.compile(project_sources.sources_needing_compilation)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape/managers/compilers.py", line 148, in compile
compiled_contracts = compiler.compile(paths_to_compile, base_path=contracts_folder)
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape_cairo/compiler.py", line 240, in compile
self.load_dependencies()
File "/Users/usesr/Downloads/shefcraft/venv/lib/python3.9/site-packages/ape_cairo/compiler.py", line 226, in load_dependencies
destination_path.write_text(source.content)
File "/Users/usesr/opt/anaconda3/lib/python3.9/pathlib.py", line 1283, in write_text
raise TypeError('data must be str, not %s' %
TypeError: data must be str, not Content
file: ape_cairo/compiler.py", line 226, in load_dependencies
if source.content:
destination_path.parent.mkdir(parents=True, exist_ok=True)
destination_path.touch()
destination_path.write_text(str(source.content)) # change source.content to str(source.content)
Fill this in if you have ideas on how the bug could be fixed.
Support full node
Upgrade to starknet.py 0.4
Make sure can connect to use full node.
Include links to any open issues that must be resolved before this feature can be implemented.
would help if you need an environment unless you are for some reason running your own Full starknet node
It's currently hadcoded to 100 gwei. Let's retrieve the real value from a block.
Dependency:
publish_contract
API method in the explorer.ape-voyager
into its own pluginUse this feature: https://voyager.online/verify
except programmatically, the same way as done with ape-etherscan
publish=True
on deployexplorer.publish_contract()
to workInclude links to any open issues that must be resolved before this feature can be implemented.
May have to poke around Starknet.py or cairo-lang to fully understand.
It is for changing code or putting some code up or something like that...
Include links to any open issues that must be resolved before this feature can be implemented.
Implement the provider method def get_contract_logs(self, log_filter: LogFilter) -> Iterator[ContractLog]:
.
Devnet supports the starknet_getEvents
RPC request.
Live networks will require a full node client (#76)
https://github.com/starkware-libs/starknet-specs/blob/v0.1.0/api/starknet_api_openrpc.json#L571-L626
Include links to any open issues that must be resolved before this feature can be implemented.
Similarly to accounts in Ethereum, let's offer a private key export CLI command for starknet acounts
ape starknet accounts export <alias:>
Include links to any open issues that must be resolved before this feature can be implemented.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.