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

     1  // SPDX-License-Identifier: GPL-3.0
     2  pragma solidity >=0.7.0 <0.9.0;
     3  
     4  contract ChainCallLevel3 {
     5      function exec(address level4Addr) public payable {
     6          bool ok;
     7          (ok, ) = level4Addr.call(abi.encodeWithSignature("exec()"));
     8          require(ok, "failed to perform call to level 4");
     9  
    10          (ok, ) = level4Addr.delegatecall(abi.encodeWithSignature("exec()"));
    11          require(ok, "failed to perform delegate call to level 4");
    12      }
    13  
    14      function get(address level4Addr) public view returns (string memory t) {
    15          bool ok;
    16          bytes memory result;
    17          
    18          (ok, result) = level4Addr.staticcall(abi.encodeWithSignature("get()"));
    19          require(ok, "failed to perform static call to level 4");
    20  
    21          t = abi.decode(result, (string));
    22      }
    23  }