foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.34k stars 1.77k forks source link

cast mktx / sign transactions without broadcasting #1273

Closed saucepoint closed 9 months ago

saucepoint commented 2 years ago

Component

Cast

Describe the feature you would like

It would be nice if cast can sign and prepare transactions without broadcasting them.

This will be especially useful for hardware wallets where a signed transaction is created (via hardware device prompts) and the transaction is broadcasted at a later time

Additional context

seth mktx returns a raw hash which can be used with seth publish (and cast publish)

https://github.com/dapphub/dapptools/tree/master/src/seth#seth-mktx

onbjerg commented 2 years ago

Ref https://github.com/gakonst/foundry/issues/1060

saucepoint commented 2 years ago

@onbjerg you can assign me the issue, i'll have an honest attempt at it over the next few days

sambacha commented 2 years ago

Ref https://github.com/gakonst/foundry/issues/1060

These are similar issues, except my issue is only asking for cast to provide the transaction details and leave the rest to the external wallet provider.

Fwiw most wallets do not allow you to return the signed transaction. They immediately broadcast it. You will most likely have to rely on eth_sign to get that functionality

onbjerg commented 2 years ago

@sambacha I'm not sure I understand #1060 then, I've left a comment.

sambacha commented 2 years ago

@sambacha I'm not sure I understand #1060 then, I've left a comment.

This is working for cast, but not for forge

yaroslavyaroslav commented 2 years ago

Are we there yet, Shrek?

There's just cast is actually unusable in Polygon, since there's only sendRaw method provided. And there's nothing to put in publish method.