Skip to content

Conversation

@vandenbogart
Copy link
Contributor

It's completely possible I am missing something, but I couldn't find a good way to access the address of the account which owns the bytecode being executed while using the Inspector::step hook. It would be really convenient if the contract stored on the interpreter also contained the bytecode address like the CallInputs it is constructed from do.

@vandenbogart vandenbogart changed the title Add bytecode_address from CallInputs to Contract during construction. feat: add bytecode_address from CallInputs to Contract during construction. Jun 26, 2024
Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to add.

But would make bytecode_address a Option in a similar way as the Contract hash is, and would put it to None if it is a creation call.

bytecode,
hash,
contract_address,
None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be added from env.tx.kind if kind is To we should set that address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I get your meaning. I set it to None in the case of create and to the destination address in the case of Call

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more nit

@rakita rakita merged commit 5507047 into bluealloy:main Jun 30, 2024
@github-actions github-actions bot mentioned this pull request Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants