Contract.getFootprint() to get the ledger key of the contract instance. That key doesn’t cover the backing WASM code, so we read the instance entry once to find its WASM hash and build the code’s ledger key from it.
Unfortunately, we still need simulation to figure out the fees for our restoration. This, however, can be easily covered by the SDK’s Server.prepareTransaction() helper, which will do simulation and assembly for us.
This guide makes use of the (aptly named)
submitTx function we created in another guide.