github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/test/contracts/auto/Called.sol (about)

     1  // SPDX-License-Identifier: GPL-3.0
     2  pragma solidity >=0.7.0 <0.9.0;
     3  
     4  contract Called {
     5      uint256 num;
     6      address sender;
     7      uint256 value;
     8  
     9      function setVars(uint256 _num) public payable {
    10          num = _num;
    11          sender = msg.sender;
    12          value = msg.value;
    13      }
    14  
    15      function setVarsViaCall(uint256 _num) public payable {
    16           bool ok;
    17          (ok, ) = address(this).call(
    18              abi.encodeWithSignature("setVars(uint256)", _num)
    19          );
    20          require(ok, "failed to perform call");
    21      }
    22  
    23      function getVars() public view returns (uint256, address, uint256) {
    24          return (num, sender, value);
    25      }
    26  
    27      function getVarsAndVariable(uint256 _num) public view returns (uint256, address, uint256, uint256) {
    28          return (num, sender, value, _num);
    29      }
    30  }