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

How to Register RootChainManager and ChildChainManager on StateSender? #83

Open
liushmh opened this issue Jun 24, 2021 · 0 comments
Open

Comments

@liushmh
Copy link

liushmh commented Jun 24, 2021

In Step 11 Register State Sync

Register RootChainManager and ChildChainManager on StateSender
Set stateSenderAddress on RootChainManager
Grant STATE_SYNCER_ROLE on ChildChainManager

Can anyone explain how to Register RootChainManager and ChildChainManager on StateSender?

Here is the StateSender contract
`contract DummyStateSender is IStateSender {
/**
* @notice Event emitted when when syncState is called
* @dev Heimdall bridge listens to this event and sends the data to receiver contract on child chain
* @param id Id of the sync, increamented for each event in case of actual state sender contract
* @param contractAddress the contract receiving data on child chain
* @param data bytes data to be sent
*/
event StateSynced(
uint256 indexed id,
address indexed contractAddress,
bytes data
);

/**
 * @notice called to send data to child chain
 * @dev sender and receiver contracts need to be registered in case of actual state sender contract
 * @param receiver the contract receiving data on child chain
 * @param data bytes data to be sent
 */
function syncState(address receiver, bytes calldata data) external override {
    emit StateSynced(1, receiver, data);
}

}`

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