Skip to content

Commit

Permalink
Add support for nested tuples / records (#84)
Browse files Browse the repository at this point in the history
* seems to work

* point to right web3

* generating contracts

* generating type syn

* wip

* nested tuples compiles

* update packages
  • Loading branch information
martyall committed Oct 6, 2023
1 parent ea7bd7e commit 9b5e2c2
Show file tree
Hide file tree
Showing 7 changed files with 922 additions and 499 deletions.
183 changes: 183 additions & 0 deletions abi-data/abis/NestedTuples.json
@@ -0,0 +1,183 @@
[
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "a1",
"type": "uint256"
},
{
"internalType": "string",
"name": "a2",
"type": "string"
}
],
"indexed": false,
"internalType": "struct NestedTuples.A",
"name": "_a",
"type": "tuple"
},
{
"components": [
{
"internalType": "string[]",
"name": "b1",
"type": "string[]"
},
{
"internalType": "bytes32",
"name": "b2",
"type": "bytes32"
}
],
"indexed": false,
"internalType": "struct NestedTuples.B",
"name": "_b",
"type": "tuple"
},
{
"components": [
{
"components": [
{
"internalType": "uint256",
"name": "a1",
"type": "uint256"
},
{
"internalType": "string",
"name": "a2",
"type": "string"
}
],
"internalType": "struct NestedTuples.A",
"name": "c1",
"type": "tuple"
},
{
"components": [
{
"internalType": "string[]",
"name": "b1",
"type": "string[]"
},
{
"internalType": "bytes32",
"name": "b2",
"type": "bytes32"
}
],
"internalType": "struct NestedTuples.B",
"name": "c2",
"type": "tuple"
}
],
"indexed": false,
"internalType": "struct NestedTuples.C[]",
"name": "_cs",
"type": "tuple[]"
}
],
"name": "Update",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "cs",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "a1",
"type": "uint256"
},
{
"internalType": "string",
"name": "a2",
"type": "string"
}
],
"internalType": "struct NestedTuples.A",
"name": "c1",
"type": "tuple"
},
{
"components": [
{
"internalType": "string[]",
"name": "b1",
"type": "string[]"
},
{
"internalType": "bytes32",
"name": "b2",
"type": "bytes32"
}
],
"internalType": "struct NestedTuples.B",
"name": "c2",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "a1",
"type": "uint256"
},
{
"internalType": "string",
"name": "a2",
"type": "string"
}
],
"internalType": "struct NestedTuples.A",
"name": "a",
"type": "tuple"
},
{
"components": [
{
"internalType": "string[]",
"name": "b1",
"type": "string[]"
},
{
"internalType": "bytes32",
"name": "b2",
"type": "bytes32"
}
],
"internalType": "struct NestedTuples.B",
"name": "b",
"type": "tuple"
}
],
"name": "update",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
174 changes: 174 additions & 0 deletions abi-data/abis/Verifier.json
@@ -0,0 +1,174 @@
[
{
"inputs": [
{
"components": [
{
"internalType": "bytes",
"name": "seal",
"type": "bytes"
},
{
"components": [
{
"internalType": "bytes32",
"name": "preStateDigest",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "postStateDigest",
"type": "bytes32"
},
{
"components": [
{
"internalType": "enum SystemExitCode",
"name": "system",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "user",
"type": "uint8"
}
],
"internalType": "struct ExitCode",
"name": "exitCode",
"type": "tuple"
},
{
"internalType": "bytes32",
"name": "input",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "output",
"type": "bytes32"
}
],
"internalType": "struct ReceiptMetadata",
"name": "meta",
"type": "tuple"
}
],
"internalType": "struct Receipt",
"name": "receipt",
"type": "tuple"
}
],
"name": "verify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "seal",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "imageId",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "postStateDigest",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "journal",
"type": "bytes"
}
],
"name": "verify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "seal",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "imageId",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "postStateDigest",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "journalHash",
"type": "bytes32"
}
],
"name": "verify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[2]",
"name": "_pA",
"type": "uint256[2]"
},
{
"internalType": "uint256[2][2]",
"name": "_pB",
"type": "uint256[2][2]"
},
{
"internalType": "uint256[2]",
"name": "_pC",
"type": "uint256[2]"
},
{
"internalType": "uint256[4]",
"name": "_pubSignals",
"type": "uint256[4]"
}
],
"name": "verifyProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
4 changes: 2 additions & 2 deletions packages.dhall
@@ -1,5 +1,5 @@
let upstream =
https://raw.githubusercontent.com/f-o-a-m/package-sets/921ac217454768ec3f614a9571c109b2ad542c07/purs-0.15.7-web3.dhall
sha256:818d12df6f7ce455657ff559798e50ec14e098f8d6acc655f674f26c7a007e3d
https://raw.githubusercontent.com/f-o-a-m/package-sets/purs-0.15-web3/purs-0.15.7-web3.dhall
sha256:cb35bdebefab6fd0d9b0a09b1f461cd8e053509b12ee17099d9324287d20f1f5

in upstream

0 comments on commit 9b5e2c2

Please sign in to comment.