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

Enable calling contracts on connected chains with caller info #344

Closed
Tracked by #2876
fadeev opened this issue Sep 5, 2024 · 0 comments · Fixed by #355
Closed
Tracked by #2876

Enable calling contracts on connected chains with caller info #344

fadeev opened this issue Sep 5, 2024 · 0 comments · Fixed by #355
Assignees

Comments

@fadeev
Copy link
Member

fadeev commented Sep 5, 2024

Right now, when a universal contract A on ZetaChain makes a gateway.call a contract B on a connected chain, contract B is executed without knowing contract A address.

This makes it virtually impossible to establish a connection for sending custom ERC-20s, NFTs and other valuables between ZetaChain and connected chains, because the message essentially comes without authentication.

The proposal is to allow universal contracts to make calls with original sender information passed as a parameter.

function onCall(
    messageContext calldata messageContext,
    bytes calldata message
) external override {}
struct messageContext {
    bytes origin;
    address sender; // not used
    uint256 chainID;
}

A simple solution could be to define this onCall interface, the onCall contains caller address, this value is authenticated, onCall is the only method that cannot be called through arbitrary call to prevent spoofing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment