Unnecessary ABI lookup
I'm attempting to run a test transaction on a local Hardhat network that's forking a public network. I suppose this isn't supported, because the UI hangs with the message "Fetching contract ABI...".
This tool would much more useful if this step were avoided, and transactions were encoded using only the query string parameters. Even if there might be security reasons to disallow sending transactions without verified contracts and ABIs, this policy prevents multi-step flows from being tested.
This is a good suggestion. You're thinking that the ABI itself would also be encoded fully in the URL?
I'm interested @ItsNickBarry if you can make the PR
One way to do it would be to encode the ABI (also suggested by @startswithaj). Another would be to change the fn field to use a full function signature, like "transfer(address,uint256)" instead of just "transfer". This alone can be used to create a single-function ABI, which is enough to encode and send the transaction.
I prefer the latter option, but it's a bit harder to do in a backwards-compatible way.
You only need to encode the part of the abi you need for the function call. For a transfer it would just be
?abi="["transfer(address,uint256)"]"
Then process it
const abi = JSON.parse(params.abi)
Otherwise we could add FnSignature as an additional parameter and if thats set ignore fn.
That's a good spec proposed @startswithaj - If you want to PR this feel free! It should be possible without a breaking change, which is preferred
Hey @dawsbot I did the PR ser, its here https://github.com/dawsbot/txn.xyz/pull/18