Getting input contract IDs for transactions

Part of our protocol involves us submitting transactions to Fuel on behalf of our users that call into user-specified smart contracts. These contracts that are called can do anything they want to, like call other contracts. This means we need some way of getting the list of input contract IDs for these transactions before we sign them

Other chains offer RPCs that let you perform a dry run of a tx and it’ll give back a list of contracts that are touched, which you can then use to craft the “real” transaction that will be signed and submitted on chain. Similar in spirit to estimating gas for a transaction before signing it, or eth_getAccessList, etc

I think we’d need something similar— e.g. a special query that would allow us to pass in a transaction, but during this dry run no input contract IDs are required. As the VM comes across calls to contracts, it would fetch the necessary info on the contract on the fly, finish running, etc and then return back to us the list of contract IDs that were touched by the transaction. Ofc it’s possible that between this dry-run query and the time that the transaction gets landed on chain, there’s some kind of state change that would require a different set of contract IDs to be passed in, but this is fine for our use case

We talked with tina and Alex Decurnou a bit about this in Denver. Is something like this possible?

@sarah pointed us to Transaction dependency estimation - The Fuel Rust SDK, sharing for future readers :slight_smile:

thanks Sarah!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.