stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

Expose nested contract calls from another contract in the API

Open Jamil opened this issue 4 years ago • 1 comments

Right now if a transaction is submitted to function A_1 on a contract A, which calls a function B_1 on contract B, there's no endpoint which exposes the fact that B_1 was called.

This is particularly difficult for running https://miamining.com, because when a mining pool contract sends a mine-many call to the MiamiCoin contract, I have to hardcode the behavior of the mining pool contract — I can't see the mine-many call anywhere directly. For example, I can readily access this transaction, but I can't see the mine-many call: https://explorer.stacks.co/txid/0xcdc8d3f75085e255a7e6d4af9670440222d7b6ea12714e61e6f3f02eb4b342ed?chain=mainnet

I know this is a bit of a larger change since I'm not sure how exactly you'd expose contract calls directly instead of just transactions, but I think it is incredibly important when trying to reconstruct the blockchain state and the state of a contract.

Jamil avatar Jan 02 '22 07:01 Jamil

Have you tried using contract logs (e.g. (print ...)) for your use case? Otherwise, this request cannot be fulfilled by the API unless significant changes are done to the core Stacks node so that it can track and report this kind of data.

zone117x avatar Jan 03 '22 17:01 zone117x

@Jamil I'll close this due to inactivity. If @zone117x's suggestion above did not resolve your issue, please reopen this with more context.

smcclellan avatar Jul 31 '23 17:07 smcclellan