SimpleStorage.sol 802 Bytes
Newer Older
rajivpoc's avatar
rajivpoc committed
1
pragma solidity ^0.8.9;
2 3 4 5 6 7 8

contract ICrossDomainMessenger {
    address public xDomainMessageSender;
}

contract SimpleStorage {
    address public msgSender;
9
    address public txOrigin;
10 11 12 13 14 15
    address public xDomainSender;
    bytes32 public value;
    uint256 public totalCount;

    function setValue(bytes32 newValue) public {
        msgSender = msg.sender;
16
        txOrigin = tx.origin;
17 18 19 20 21 22
        xDomainSender = ICrossDomainMessenger(msg.sender)
            .xDomainMessageSender();
        value = newValue;
        totalCount++;
    }

23 24
    function setValueNotXDomain(bytes32 newValue) public {
        msgSender = msg.sender;
25
        txOrigin = tx.origin;
26 27 28 29
        value = newValue;
        totalCount++;
    }

30 31 32 33
    function dumbSetValue(bytes32 newValue) public {
        value = newValue;
    }
}