You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently result of the event that is processed from the A chain, will be returned to the A chain. With callback field in PQL definition we can modify this behaviour to submit the result to a different chain B. This will allow for signaling between different chains. Suppose we have a bridge between chains A <-> B. The bridge allows for sending assets between chains A and B, but does not allow calling arbitrary contract functions. The callback field could be used in this case. Suppose we want to send 100 ETH from chain A to chain B and invest it into contract '0xdeadbeef0' located on the chain B:
Chain A:
contractChainAContract {
ParalinkOracle oracle;
BridgeAdapter bridge;
function investIntoContractOnChainB(uint256_amount, address_contractAddressChainB, address_callbackFunctionIdChainB) {
bytes32 ipfsHash; // Includes callback fielduint256 nonce;
bridge.transfer(_amount, _contractAddressChainB); // we would need bridge TX ID to identify it on the other side
oracle.request(
ipfsHash,
msg.sender,
contractAddressChainB,
callbackFunctionIdChainB,
nonce,
""
);
// oracle.request emits Request event, which is processed by the paralink node// Paralink node monitors the contractAddressChainB contract on chain B for the deposit TX ID to occur.// When the deposit happens, the node calls `callbackFunctionIdChainB` to process the deposited assets.// Paralink node calls the chain A `fullfillRequest` to mark the request as done.
}
}
Chain B:
// address 0xBb2b8038a1640196FbE3e38816F3e67Cba72D940contractChainBContract {
function callback(bytes32_data) {
// process _datainvestAsset(amount, address);
}
}
callback field would be similar to current eth.* calls:
This assumes we have unique ID chains for all the possible chains. The matter should be researched more as I am sure there are some limitations that are not taken into the account.
The text was updated successfully, but these errors were encountered:
Currently result of the event that is processed from the A chain, will be returned to the A chain. With
callback
field in PQL definition we can modify this behaviour to submit the result to a different chain B. This will allow for signaling between different chains. Suppose we have a bridge between chains A <-> B. The bridge allows for sending assets between chains A and B, but does not allow calling arbitrary contract functions. Thecallback
field could be used in this case. Suppose we want to send 100 ETH from chain A to chain B and invest it into contract '0xdeadbeef0' located on the chain B:Chain A:
Chain B:
callback
field would be similar to currenteth.*
calls:This assumes we have unique ID chains for all the possible chains. The matter should be researched more as I am sure there are some limitations that are not taken into the account.
The text was updated successfully, but these errors were encountered: