-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
113 additions
and
27 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"constant": false, "inputs": [{"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "nfs", "type": "uint256[2]"}], "name": "check_mkroot_nullifiers_hsig_append_nullifiers_state", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
608060405234801561001057600080fd5b50610313806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639cab510014610030575b600080fd5b6100d4600480360360c081101561004657600080fd5b8101908080608001906004806020026040519081016040528092919082600460200280828437600081840152601f19601f820116905080830192505050505050919291929080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f82011690508083019250505050505091929192905050506100ea565b6040518082815260200191505060405180910390f35b60006060600260405190808252806020026020018201604052801561011e5781602001602082028038833980820191505090505b5090508260006002811061012e57fe5b602002015160001b8160008151811061014357fe5b6020026020010181815250508260016002811061015c57fe5b602002015160001b8160018151811061017157fe5b60200260200101818152505060006002828660405160200180838051906020019060200280838360005b838110156101b657808201518184015260208101905061019b565b5050505090500182600460200280838360005b838110156101e45780820151818401526020810190506101c9565b50505050905001925050506040516020818303038152906040526040518082805190602001908083835b60208310610231578051825260208201915060208101905060208303925061020e565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610273573d6000803e3d6000fd5b5050506040513d602081101561028857600080fd5b8101908080519060200190929190505050905060007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190506000818360001c816102ce57fe5b069050809450505050509291505056fea265627a7a72315820bf74a6ac9ceb0fa0d11c95916dd42c3e08f27f8a94c9a4169e1f000465c7089164736f6c63430005110032 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# template for codegen | ||
from python_web3.client.bcosclient import ( | ||
BcosClient | ||
) | ||
from python_web3.client.datatype_parser import DatatypeParser | ||
import json | ||
|
||
|
||
class Test1: # name of abi | ||
address = None | ||
contract_abi_string = '''[{"constant": false, "inputs": [{"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "nfs", "type": "uint256[2]"}], "name": "check_mkroot_nullifiers_hsig_append_nullifiers_state", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}]''' | ||
contract_abi = None | ||
data_parser = DatatypeParser() | ||
client = None | ||
|
||
def __init__(self, address): | ||
self.client = BcosClient() | ||
self.address = address | ||
self.contract_abi = json.loads(self.contract_abi_string) | ||
self.data_parser.set_abi(self.contract_abi) | ||
|
||
def deploy(self, contract_bin_file): | ||
result = self.client.deployFromFile(contract_bin_file) | ||
self.address = result["contractAddress"] | ||
return result | ||
|
||
# ------------------------------------------ | ||
def check_mkroot_nullifiers_hsig_append_nullifiers_state(self, vk, nfs): | ||
func_name = 'check_mkroot_nullifiers_hsig_append_nullifiers_state' | ||
args = [vk, nfs] | ||
receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) | ||
outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) | ||
return outputresult, receipt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.