Module Pi2

Source
Expand description

Generated by the following Solidity interface…

interface Pi2 {
    struct Account {
        AccountProof proof;
        bytes code;
    }
    struct AccountProof {
        address addr;
        bytes[] accountProof;
        uint256 balance;
        bytes32 codeHash;
        uint256 nonce;
        bytes32 storageHash;
        StorageProof[] storageProof;
    }
    struct Claim {
        string claimType;
        string trustBaseSpec;
        Header assumptions;
        EVMCall action;
        bytes result;
        EVMMetadata metadata;
    }
    struct EVMCall {
        address from;
        address to;
        bytes input;
    }
    struct EVMMetadata {
        uint256 chainId;
    }
    struct Header {
        bytes32 parentHash;
        bytes32 uncleHash;
        address coinbase;
        bytes32 root;
        bytes32 txHash;
        bytes32 receiptHash;
        bytes bloom;
        uint256 difficulty;
        uint256 number;
        uint256 gasLimit;
        uint256 gasUsed;
        uint256 time;
        bytes extra;
        bytes32 mixDigest;
        bytes8 nonce;
    }
    struct StorageProof {
        bytes32 key;
        bytes32 value;
        bytes[] proof;
    }
    struct VerificationData {
        Account[] accounts;
    }

    event ClaimAppended(Claim claim, VerificationData indexed verData);

    function verify(Claim memory claim, VerificationData memory verData) external pure;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "function",
    "name": "verify",
    "inputs": [
      {
        "name": "claim",
        "type": "tuple",
        "internalType": "struct Pi2.Claim",
        "components": [
          {
            "name": "claimType",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "trustBaseSpec",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "assumptions",
            "type": "tuple",
            "internalType": "struct Pi2.Header",
            "components": [
              {
                "name": "parentHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "uncleHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "coinbase",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "root",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "txHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "receiptHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "bloom",
                "type": "bytes",
                "internalType": "bytes"
              },
              {
                "name": "difficulty",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "number",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "gasLimit",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "gasUsed",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "time",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "extra",
                "type": "bytes",
                "internalType": "bytes"
              },
              {
                "name": "mixDigest",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "nonce",
                "type": "bytes8",
                "internalType": "bytes8"
              }
            ]
          },
          {
            "name": "action",
            "type": "tuple",
            "internalType": "struct Pi2.EVMCall",
            "components": [
              {
                "name": "from",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "to",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "input",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          },
          {
            "name": "result",
            "type": "bytes",
            "internalType": "bytes"
          },
          {
            "name": "metadata",
            "type": "tuple",
            "internalType": "struct Pi2.EVMMetadata",
            "components": [
              {
                "name": "chainId",
                "type": "uint256",
                "internalType": "uint256"
              }
            ]
          }
        ]
      },
      {
        "name": "verData",
        "type": "tuple",
        "internalType": "struct Pi2.VerificationData",
        "components": [
          {
            "name": "accounts",
            "type": "tuple[]",
            "internalType": "struct Pi2.Account[]",
            "components": [
              {
                "name": "proof",
                "type": "tuple",
                "internalType": "struct Pi2.AccountProof",
                "components": [
                  {
                    "name": "addr",
                    "type": "address",
                    "internalType": "address"
                  },
                  {
                    "name": "accountProof",
                    "type": "bytes[]",
                    "internalType": "bytes[]"
                  },
                  {
                    "name": "balance",
                    "type": "uint256",
                    "internalType": "uint256"
                  },
                  {
                    "name": "codeHash",
                    "type": "bytes32",
                    "internalType": "bytes32"
                  },
                  {
                    "name": "nonce",
                    "type": "uint256",
                    "internalType": "uint256"
                  },
                  {
                    "name": "storageHash",
                    "type": "bytes32",
                    "internalType": "bytes32"
                  },
                  {
                    "name": "storageProof",
                    "type": "tuple[]",
                    "internalType": "struct Pi2.StorageProof[]",
                    "components": [
                      {
                        "name": "key",
                        "type": "bytes32",
                        "internalType": "bytes32"
                      },
                      {
                        "name": "value",
                        "type": "bytes32",
                        "internalType": "bytes32"
                      },
                      {
                        "name": "proof",
                        "type": "bytes[]",
                        "internalType": "bytes[]"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "code",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "pure"
  },
  {
    "type": "event",
    "name": "ClaimAppended",
    "inputs": [
      {
        "name": "claim",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Pi2.Claim",
        "components": [
          {
            "name": "claimType",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "trustBaseSpec",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "assumptions",
            "type": "tuple",
            "internalType": "struct Pi2.Header",
            "components": [
              {
                "name": "parentHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "uncleHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "coinbase",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "root",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "txHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "receiptHash",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "bloom",
                "type": "bytes",
                "internalType": "bytes"
              },
              {
                "name": "difficulty",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "number",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "gasLimit",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "gasUsed",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "time",
                "type": "uint256",
                "internalType": "uint256"
              },
              {
                "name": "extra",
                "type": "bytes",
                "internalType": "bytes"
              },
              {
                "name": "mixDigest",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "nonce",
                "type": "bytes8",
                "internalType": "bytes8"
              }
            ]
          },
          {
            "name": "action",
            "type": "tuple",
            "internalType": "struct Pi2.EVMCall",
            "components": [
              {
                "name": "from",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "to",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "input",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          },
          {
            "name": "result",
            "type": "bytes",
            "internalType": "bytes"
          },
          {
            "name": "metadata",
            "type": "tuple",
            "internalType": "struct Pi2.EVMMetadata",
            "components": [
              {
                "name": "chainId",
                "type": "uint256",
                "internalType": "uint256"
              }
            ]
          }
        ]
      },
      {
        "name": "verData",
        "type": "tuple",
        "indexed": true,
        "internalType": "struct Pi2.VerificationData",
        "components": [
          {
            "name": "accounts",
            "type": "tuple[]",
            "internalType": "struct Pi2.Account[]",
            "components": [
              {
                "name": "proof",
                "type": "tuple",
                "internalType": "struct Pi2.AccountProof",
                "components": [
                  {
                    "name": "addr",
                    "type": "address",
                    "internalType": "address"
                  },
                  {
                    "name": "accountProof",
                    "type": "bytes[]",
                    "internalType": "bytes[]"
                  },
                  {
                    "name": "balance",
                    "type": "uint256",
                    "internalType": "uint256"
                  },
                  {
                    "name": "codeHash",
                    "type": "bytes32",
                    "internalType": "bytes32"
                  },
                  {
                    "name": "nonce",
                    "type": "uint256",
                    "internalType": "uint256"
                  },
                  {
                    "name": "storageHash",
                    "type": "bytes32",
                    "internalType": "bytes32"
                  },
                  {
                    "name": "storageProof",
                    "type": "tuple[]",
                    "internalType": "struct Pi2.StorageProof[]",
                    "components": [
                      {
                        "name": "key",
                        "type": "bytes32",
                        "internalType": "bytes32"
                      },
                      {
                        "name": "value",
                        "type": "bytes32",
                        "internalType": "bytes32"
                      },
                      {
                        "name": "proof",
                        "type": "bytes[]",
                        "internalType": "bytes[]"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "code",
                "type": "bytes",
                "internalType": "bytes"
              }
            ]
          }
        ]
      }
    ],
    "anonymous": false
  }
]

Structs§

Account
AccountProof
Claim
ClaimAppended
Event with signature ClaimAppended((string,string,(bytes32,bytes32,address,bytes32,bytes32,bytes32,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes32,bytes8),(address,address,bytes),bytes,(uint256)),(((address,bytes[],uint256,bytes32,uint256,bytes32,(bytes32,bytes32,bytes[])[]),bytes)[])) and selector 0x2aaddb84d033d8bd501fa7185627cee29c4081b3eb6b1799a72ded83291e2784.
EVMCall
EVMMetadata
Header
Pi2Instance
A Pi2 instance.
StorageProof
VerificationData
verifyCall
Function with signature verify((string,string,(bytes32,bytes32,address,bytes32,bytes32,bytes32,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes32,bytes8),(address,address,bytes),bytes,(uint256)),(((address,bytes[],uint256,bytes32,uint256,bytes32,(bytes32,bytes32,bytes[])[]),bytes)[])) and selector 0x0b0e9659.
verifyReturn
Container type for the return parameters of the verify((string,string,(bytes32,bytes32,address,bytes32,bytes32,bytes32,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes32,bytes8),(address,address,bytes),bytes,(uint256)),(((address,bytes[],uint256,bytes32,uint256,bytes32,(bytes32,bytes32,bytes[])[]),bytes)[])) function.

Enums§

Pi2Calls
Container for all the Pi2 function calls.
Pi2Events
Container for all the Pi2 events.

Statics§

BYTECODE
The creation / init bytecode of the contract.
DEPLOYED_BYTECODE
The runtime bytecode of the contract, as deployed on the network.

Functions§

deploy
Deploys this contract using the given provider and constructor arguments, if any.
deploy_builder
Creates a RawCallBuilder for deploying this contract using the given provider and constructor arguments, if any.
new
Creates a new wrapper around an on-chain Pi2 contract instance.