Comments (25)
Update: I'm working on this. I'm an absolute beginner, please allow me some time.
from foundry.
I'll add comments to this issue for features that I've noticed are missing as I attempt to replace seth
with cast
during my normal usage:
-
cast call
does not support the--block <block>
flag for querying historical data — done in #638 - as noted in the readme,
cast run-tx
is not supported—I used the--trace
and--debug
modes often - added in #1358 -
cast client
— added in #635 -
cast sig
— added in #645 -
cast index
not supported — any ideas for better syntax thanseth index
? — added in #676 -
cast call <addr> <0xCalldata>
is not supported. Probably just need a.starts_with('0x')
block here? —done in #742 -
cast abi-encode
with ints not supported, e.g.cast abi-encode "x(int256)" "-123"
errors with "Found argument '-1' which wasn't expected, or isn't valid in this context" fixed in #584 - Support for signed integers is lacking. gakonst/ethers-rs#842 should be completed first to make this simpler
- unsupported in
cast --to-fix
because incast/src/lib.rs
theto_fix
method only takes a U256. Ideal solution is to add support to ethers-rsformat_units
and pass through to that method - unsupported in
cast --from-wei
because incast/src/lib.rs
thefrom_wei
method (1) takes an U256 and (2) passes through to ethers-rsformat_units
which does not support integers - unsupported in
cast --to-wei
because incast/src/lib.rs
theto_wei
method (1) takes an U256 and (2) passes through to ethers-rsparse_units
which does not support integers - unsupported in
cast calldata
because inutils/src/lib.rs
theencode_args
method callsparse_tokens
which errors withFailed to parse tokens
, though I have not looked into why
- unsupported in
from foundry.
Ok so to sum up:
-
cast accounts
/cast ls
(they could just be merged intocast wallet ls
?) -
cast send --create
-
cast logs
-
cast mktx
Optionally also cast bundle-source
but there probably isn't a lot of usage for that command. Seems like seth bundle-source
was primarily used to get source maps for seth run-tx
and the DappTools debugger, but we should try to make this automatic or push Etherscan to include source maps in their API.
from foundry.
Closing, everything in here is implemented except cast mktx
which is unplanned, and cast events
/cast accounts
that have separate issues
from foundry.
There are 2 reasons why I still use seth
over cast
--rpc-url
defaults tohttp://localhost:8545
without needing to set an env var, so I can omit adding it when I port forward my remote geth node- The table response is pretty printed (ie hex strings are turned into integers, easier for human consumption)
from foundry.
I've personally never used it and would be ok not adding it proactively, and perhaps we wait until its requested and discuss then?
from foundry.
There is another command that could be useful - seth rpc
which doesn't seem to completely work when passing args, but it does work when the RPC accepts no arguments. This would be useful to call RPCs that don't already have cast
commands. I think something like this would be helpful to cut out the curl -H ...
boilerplate.
cast rpc <rpc-method> <arg 1> <arg 2> ...
Delineating between types here would need to be handled, for example strings vs numbers. geth
will only accept numbers at times, not strings of numbers. So strings would need to be explicit, like '"3"'
would be a string and "3"
or 3
would be a number. The response json could return the jsonrpc result
field and it could be easily composed with jq
from foundry.
Update: I'm working on this. I'm an absolute beginner, please allow me some time.
I have started working on this as well. Perhaps we can coordinate and not implement the same functionality.
I have opened a draft PR while I work on it #284 and I note what I work on. Perhaps you can do as well or write a reply there?
from foundry.
I'm working on cast index
, after implementing exaclty what seth does, we can discus how to improve the syntax.
from foundry.
sign exists under "cast wallet"
from foundry.
@onbjerg exactly, many side-chains does not have direct support to retrieve the source code from etherscan, so adding the source code of the deployed contract on the path is how seth is doing.
from foundry.
Makes sense - we don't have support for this yet, let's track in a separate feature issue (pls open one @henry-hz) and we can discuss there
from foundry.
@gakonst let's make this a good first issue and rename it to cast.
from foundry.
Can a Rust newbie take this up?
from foundry.
Yes! These are small self-contained commands, so shouldn't require much. Take a look at the PRs linked in the OP for guidance. Also happy to review.
from foundry.
-
cast send --create
is missing as well
from foundry.
Seems like the last two remaining items are cast send --create
and I256 support?
from foundry.
Seems like the last two remaining items are
cast send --create
and I256 support?
cast ls
and cast accounts
are missing as well. It's convenient to know which wallets you currently have access to. I do think the commands can be improved upon
from foundry.
Other features missing, from comparing the outputs of seth
and cast
--from-ascii
bundle-source
, though I don't think we need this onelogs
mktx
sign
solc
I'm not sure how many of these are used so we may not care about getting exact parity.
from foundry.
solc
What is this one?
--from-ascii
We do have this one 😄
from foundry.
Ah, --from-ascii
doesn't show up when running cast -h
, but yes just confirmed it is there under an alias for --from-utf8
solc
lets you "compile a single file using a default --standard-json input"
from foundry.
Not sure we want that necessarily? 🤔
from foundry.
Hi :) Does cast run remote debugging with custom source ? In the example below, it's possible to start the debugger in FUSE network without the need of Etherscan.
seth run-tx --debug 0xc3b63ab002d4a16fe95566a9c0816fab6cf07ac9867bd5ad1319095cef13b9a2 --source out/dapp.sol.json
from foundry.
I'm not entirely sure I understand - you want to optionally use local sources for decoding with cast run
? I don't think this is currently possible - feel free to open up a feature request so we can track it better :)
from foundry.
Ok!
Done
from foundry.
Related Issues (20)
- Cast abi-decode crashes HOT 1
- Forge is failing to deploy valid contract HOT 5
- Setting for `include_storage` in invariant tests seems to leak into fuzz tests settings HOT 2
- Called contract seemingly randomly exits HOT 5
- forge verify-contract error when using --chain parameter
- feat(cheatcodes): `vm.mockCalls()` for mocking multiple calls
- Failed to deserialize response
- Challenges in Directly Accessing Nested Mappings within Structs in Solidity for Testing
- Support resetting from forked to non forked on anvil_reset HOT 2
- add the ability to select a given chain in the scripts HOT 2
- Coverage report misses return-declared variables if returned as-is
- anvil: configure memory limit HOT 3
- Foundry panics after executing 3 transactions using `transact` on a forked state HOT 1
- Deserialization Error: EOF while parsing a value at line 1 column 0 HOT 4
- Etherscan Multichain Contract Verification
- Max Priority gas price does not work HOT 2
- Feature request: `input.index(key)` HOT 3
- Feature request: `--disable-metadata` as CLI option to `forge build`
- anvil: EVM error MemoryLimitOOG HOT 10
- Retrieving default `arbitrum_one` rpc url fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry.