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

     1  // SPDX-License-Identifier: GPL-3.0
     2  
     3  pragma solidity >=0.7.0 <0.9.0;
     4  
     5  contract Read {
     6      struct token {
     7          string Name;
     8          uint256 Quantity;
     9          address Address;
    10      }
    11  
    12      address public Owner;
    13      string public OwnerName;
    14      uint256 public Value = 1;
    15      mapping(address => token) public Tokens;
    16  
    17      constructor(string memory name) {
    18          OwnerName = name;
    19          Owner = msg.sender;
    20      }
    21  
    22      function publicGetOwnerName() public view returns (string memory) {
    23          return OwnerName;
    24      }
    25  
    26      function externalGetOwnerName() external view returns (string memory) {
    27          return OwnerName;
    28      }
    29  
    30      function publicAddToken(token memory t) public {
    31          Tokens[t.Address] = t;
    32      }
    33  
    34      function externalAddToken(token memory t) external {
    35          Tokens[t.Address] = t;
    36      }
    37  
    38      function publicGetToken(address a) public view returns (token memory) {
    39          return Tokens[a];
    40      }
    41  
    42      function externalGetToken(address a) external view returns (token memory) {
    43          return Tokens[a];
    44      }
    45  
    46      function publicRead() public view returns (uint256) {
    47          return Value;
    48      }
    49  
    50      function externalRead() external view returns (uint256) {
    51          return Value;
    52      }
    53  
    54      function publicReadWParams(uint256 p) public view returns (uint256) {
    55          return Value + p;
    56      }
    57  
    58      function externalReadWParams(uint256 p) external view returns (uint256) {
    59          return Value + p;
    60      }
    61  }