Root chain side of a Polygon data bridge meant to execute commands on the child chain
This can be used to forward commands given by the DAO to be executed on the child chain
Note this contains internal vars as well due to a bug in the docgen procedure
Var | Type |
---|---|
latestData | bytes |
PolygonDAORoot constructor
calls FxBaseRootTunnel(_checkpointManager, _fxRoot)
function constructor(
address _checkpointManager,
address _fxRoot
) public FxBaseRootTunnel
Modifier |
---|
FxBaseRootTunnel |
Arg | Type | Description |
---|---|---|
_checkpointManager |
address | Address of RootChainProxy from https://github.com/maticnetwork/static/tree/master/network |
_fxRoot |
address | Address of FxStateRootTunnel from https://docs.matic.network/docs/develop/l1-l2-communication/state-transfer/ |
Used to receive message from child chain
Not currently used
function _processMessageFromChild(
bytes _data
) internal
No modifiers
Arg | Type | Description |
---|---|---|
_data |
bytes | Data received from child chain |
Sends a payload to be executed on the child chain
Payload needs to be encoded like abi.encode(_target, _value, _data)
function sendMessageToChild(
bytes _message
) public onlyOwner
Modifier |
---|
onlyOwner |
Arg | Type | Description |
---|---|---|
_message |
bytes | payload to execute on the child chain |
Encodes and sends a payload to be executed on the child chain
This is what you will use most of the time. Emits CallOnChild
function callOnChild(
address _target,
uint256 _value,
bytes _data
) public onlyOwner
Modifier |
---|
onlyOwner |
Arg | Type | Description |
---|---|---|
_target |
address | Address on child chain against which to execute the tx |
_value |
uint256 | Value to transfer |
_data |
bytes | Calldata for the child tx |
Logs a call being forwarded to the child chain
Emitted when callOnChild is called
Param | Type | Indexed | Description |
---|---|---|---|
caller |
address | ✅ | Address that called callOnChild |
target |
address | Target of call on the child chain | |
value |
uint256 | Value to transfer on execution | |
sig |
bytes4 | Signature of function that will be called |