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

msg.sender functionality #1

Closed
drinkcoffee opened this issue Jan 26, 2021 · 1 comment
Closed

msg.sender functionality #1

drinkcoffee opened this issue Jan 26, 2021 · 1 comment

Comments

@drinkcoffee
Copy link
Contributor

Ethereum contracts allow allow the caller to be determined by looking at msg.sender. This can be used to check that a contract is being called by a specific other contract. This functionality could be emulated in the GPACT system by having a function that returns the blockchain id and address of the contract that called the current contract.

The Cross-Blockchain Control contract could have functions to return these values. The contract could look at the call graph to determine these values, plus to the entry point contract for this blockchain.

@drinkcoffee
Copy link
Contributor Author

A function has been added to the Crosschain Control Contract to allow for this functionality.

function whoCalledMe() external view override returns (uint256 targetBlockchainId, address targetContract)
in https://github.com/ConsenSys/gpact/blob/master/contracts/solidity/crossblockchaincontrol/src/main/solidity/CrosschainControl.sol
can be used to determine which blockchain and contract was the entry point at the root or segment above the active segment.

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

No branches or pull requests

1 participant