Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: tx.origin and msg.sender to the remote zEVM omni-chain contract call #832

Closed
Tracked by #838
brewmaster012 opened this issue Jul 20, 2023 · 2 comments · Fixed by #912
Closed
Tracked by #838

add: tx.origin and msg.sender to the remote zEVM omni-chain contract call #832

brewmaster012 opened this issue Jul 20, 2023 · 2 comments · Fixed by #912
Assignees

Comments

@brewmaster012
Copy link
Collaborator

brewmaster012 commented Jul 20, 2023

Synopsis
To be able to be called remoted on an foreign chain, the zEVM contract must conform to this interface

    function onCrossChainCall(address zrc20, uint256 amount, bytes calldata message) external;

This interface does not provide any information as to who the remote caller address is (analogous to Ethereum tx.origin and msg.sender).

Propose to add a context field to the interface so that zEVM omni-chain contract can obtain information as to who remotely invoked the contract.

    function onCrossChainCall(Context ctx, address zrc20, uint256 amount, bytes calldata message) external;

where context is a struct

struct Context {
        bytes origin; // similar to tx.origin, bytes becasue it could be from bitcoin
        address sender; // similar to msg.sender; empty if on bitcoin network 
        uint64 chainID; // foreign chain id from which this contract is remotely called
    }

Affected components:
SystemContract: change according to the interface change; needs to be redeployed on athens3;
Inbound Transaction Voter: Needs to supply tx.origin and msg.sender information.
zEVM I/O contracts: needs to change onCrossChainCall interface and re-deployed.

@brewmaster012 brewmaster012 mentioned this issue Jul 24, 2023
Closed
@lumtis
Copy link
Member

lumtis commented Jul 26, 2023

Is it the same task as #828?

@brewmaster012
Copy link
Collaborator Author

Is it the same task as #828?

yes let's close #828

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 a pull request may close this issue.

2 participants