mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
29 lines
648 B
Solidity
29 lines
648 B
Solidity
|
// SPDX-License-Identifier: GPL-3.0
|
||
|
|
||
|
pragma solidity ^0.8.6;
|
||
|
|
||
|
import { TestStateSender } from "./teststatesender.sol";
|
||
|
|
||
|
contract RootSender {
|
||
|
TestStateSender stateSender;
|
||
|
address childStateReceiver;
|
||
|
mapping(address => uint) public sent;
|
||
|
|
||
|
constructor(
|
||
|
address stateSender_,
|
||
|
address childStateReceiver_
|
||
|
) {
|
||
|
stateSender = TestStateSender(stateSender_);
|
||
|
childStateReceiver = childStateReceiver_;
|
||
|
}
|
||
|
|
||
|
function sendToChild(uint amount) external {
|
||
|
uint total = sent[msg.sender];
|
||
|
sent[msg.sender] = total + amount;
|
||
|
|
||
|
stateSender.syncState(
|
||
|
childStateReceiver,
|
||
|
abi.encode(msg.sender, amount)
|
||
|
);
|
||
|
}
|
||
|
}
|