solidity合约生成成Java代码-vscode工具

1、安装 Visual Studio Code  https://code.visualstudio.com/

安装将自动添加到系统变量的Path中,在cmd执行code -v可以查看到版本号即为安装成功

2、安装好后,打开,进入 expand 选择插件,输入 lang 选择中文简体  重启 vsCode ,进入 扩展,输入 solidity 进行安装

3、安装 node.js   https://nodejs.org/zh-cn/

         选择安装路径,例如 D:\devTools\node_js\,后续选择均默认

        打开cmd 命令窗口,执行node -v 和 npm -v  查看到版本信息 则安装成功

4、修改node.js 的 全局模块 和 缓存目录 路径

         a. 在node.js安装目录下新建文件夹 node_global  和  node_cache

         b.打开cmd 命令窗口,执行以下命令:

npm config set prefix "D:\devTools\node_js\node_global"
npm config set cache "D:\devTools\node_js\node_cache"

        c.在桌面 此电脑 右键 选择属性-高级系统设置-环境变量-系统变量 中新建一个变量名为"NODE_PATH",值为node_modules文件夹的路径 D:\devTools\node_js\node_modules

        d. 编辑用户变量的Path,将npm路径由C:\Users\Dell\AppData\Roaming\npm修改为node_global文件夹路径, 如果没有 npm路径,那么直接 新增一条记录即可

        e. 打开cmd命令窗口, 执行

 npm install webpack -g

         然后安装后可以在 node_global 文件夹的 node_modules 文件夹中查看到安装的模块 

        f. 打开cmd命令窗口, 执行 

npm webpack -v

        可以查看到对应的版本号,即为安装成功

5、重启 vs_code ,在下方终端,执行命令安装openzeppelin  代码库

npm i @openzeppelin/contracts@4.4.0

 

打开一个新的文件夹,新建 合约文件,例如名字叫  Dart.sol

编写好后,直接按 F5,会自动编译合约 生成文件

 6、安装 web3j 工具,生成java代码 链接:  web3j-cli

 解压下载的 web3j  工具,文件夹内会包含 bin 和 lib 两个文件夹

使用 web3j 工具,生成代码

进入目录 D:\devTools\web3j-1.4.1\bin  打开cmd ,执行命令

-o . 生成在当前目录  -p org.web3j.generated.contracts 生成代码的包名

web3j generate solidity -b D:\workspace\eth_solidity\bin\Dart.bin -a D:\workspace\eth_solidity\bin\Dart.abi  -o . -p org.web3j.generated.contracts 

 出现以下界面 说明生成成功

package org.web3j.generated.contracts;

import io.reactivex.Flowable;
import io.reactivex.functions.Function;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.DynamicBytes;
import org.web3j.abi.datatypes.DynamicStruct;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 1.4.1.
 */
@SuppressWarnings("rawtypes")
public class Dart extends Contract {
    public static final String BINARY = "608060405260006006553480156200001657600080fd5b506040516200307438038062003074833981016040819052620000399162000128565b8181600062000049838262000221565b50600162000058828262000221565b5050505050620002ed565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008b57600080fd5b81516001600160401b0380821115620000a857620000a862000063565b604051601f8301601f19908116603f01168101908282118183101715620000d357620000d362000063565b81604052838152602092508683858801011115620000f057600080fd5b600091505b83821015620001145785820183015181830184015290820190620000f5565b600093810190920192909252949350505050565b600080604083850312156200013c57600080fd5b82516001600160401b03808211156200015457600080fd5b620001628683870162000079565b935060208501519150808211156200017957600080fd5b50620001888582860162000079565b9150509250929050565b600181811c90821680620001a757607f821691505b602082108103620001c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021c57600081815260208120601f850160051c81016020861015620001f75750805b601f850160051c820191505b81811015620002185782815560010162000203565b5050505b505050565b81516001600160401b038111156200023d576200023d62000063565b62000255816200024e845462000192565b84620001ce565b602080601f8311600181146200028d5760008415620002745750858301515b600019600386901b1c1916600185901b17855562000218565b600085815260208120601f198616915b82811015620002be578886015182559484019460019091019084016200029d565b5085821015620002dd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612d7780620002fd6000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c806370a08231116100b8578063b5bd9f421161007c578063b5bd9f4214610299578063b88d4fde146102ac578063bb119f6e146102bf578063c87b56dd146102df578063e578e53e146102f2578063e985e9c51461031557600080fd5b806370a082311461023857806391d6df7d1461024b57806395d89b411461025e578063a22cb46514610266578063b12e11731461027957600080fd5b8063095ea7b3116100ff578063095ea7b3146101d957806323b872dd146101ec57806342842e0e146101ff5780636352211e146102125780636c3e8e9c1461022557600080fd5b8062e427ea1461013b57806301ffc9a714610161578063036ebef91461018457806306fdde0314610199578063081812fc146101ae575b600080fd5b61014e610149366004612418565b610351565b6040519081526020015b60405180910390f35b61017461016f366004612502565b610985565b6040519015158152602001610158565b61019761019236600461251f565b6109d7565b005b6101a1610c9b565b60405161015891906125b1565b6101c16101bc3660046125c4565b610d2d565b6040516001600160a01b039091168152602001610158565b6101976101e73660046125dd565b610dc2565b6101976101fa366004612607565b610ed7565b61019761020d366004612607565b610f08565b6101c16102203660046125c4565b610f23565b6101a16102333660046125c4565b610f9a565b61014e610246366004612643565b610fc4565b6101a16102593660046125c4565b61104b565b6101a161105f565b61019761027436600461265e565b61106e565b61028c61028736600461269a565b61107d565b60405161015891906126bc565b61014e6102a7366004612782565b611427565b6101976102ba36600461285a565b611736565b6102d26102cd3660046125c4565b61176e565b60405161015891906128d6565b6101a16102ed3660046125c4565b611b0c565b61014e6103003660046125c4565b633b9c50a86020526000908152604090205481565b6101746103233660046129af565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000806008886127108110610368576103686129e2565b620186aa02019050600081600901886127108110610388576103886129e2565b600a0201604051806101400160405290816000820154815260200160018201548152602001600282015481526020016003820180546103c6906129f8565b80601f01602080910402602001604051908101604052809291908181526020018280546103f2906129f8565b801561043f5780601f106104145761010080835404028352916020019161043f565b820191906000526020600020905b81548152906001019060200180831161042257829003601f168201915b50505050508152602001600482018054610458906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610484906129f8565b80156104d15780601f106104a6576101008083540402835291602001916104d1565b820191906000526020600020905b8154815290600101906020018083116104b457829003601f168201915b505050505081526020016005820180546104ea906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610516906129f8565b80156105635780601f1061053857610100808354040283529160200191610563565b820191906000526020600020905b81548152906001019060200180831161054657829003601f168201915b505050918352505060068201546001600160a01b03166020820152600782015460408201526008820154606082015260099091015460ff161515608090910152610120810151909150156105ef5760405162461bcd60e51b815260206004820152600e60248201526d1d1bdad95b881a185cc81cd95b9960921b60448201526064015b60405180910390fd5b620186a982015460ff166106395760405162461bcd60e51b81526020600482015260116024820152701c1c9bd91d58dd081b9bdd081d985b1a59607a1b60448201526064016105e6565b878260010154118015610658575060058201546001600160a01b031633145b801561066c57506001600160a01b038a1615155b6106a95760405162461bcd60e51b815260206004820152600e60248201526d1d5cd95c881b9bdd081d985b1a5960921b60448201526064016105e6565b6106b7600780546001019055565b60006106c260075490565b90506106ce8b82611bf3565b6002886040516020016106e19190612a32565b60408051601f19818403018152908290526106fb91612a32565b602060405180830381855afa158015610718573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061073b9190612a4e565b836009018a6127108110610751576107516129e2565b600a02016002018190555086836009018a6127108110610773576107736129e2565b600a020160030190816107869190612ab5565b5085836009018a612710811061079e5761079e6129e2565b600a020160040190816107b19190612ab5565b5080836009018a61271081106107c9576107c96129e2565b600a02016001018190555084836009018a61271081106107eb576107eb6129e2565b600a020160050190816107fe9190612ab5565b508a836009018a6127108110610816576108166129e2565b600a020160060160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001836009018a6127108110610859576108596129e2565b600a020160090160006101000a81548160ff02191690831515021790555089836009018a612710811061088e5761088e6129e2565b600a020160080181905550600060028a8c6127106108ac9190612b8b565b6108b69190612ba2565b6040516020016108c891815260200190565b60408051601f19818403018152908290526108e291612a32565b602060405180830381855afa1580156108ff573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906109229190612a4e565b905080846009018b612710811061093b5761093b6129e2565b600a02016007018190555089846009018b612710811061095d5761095d6129e2565b600a02015550505060009788525050633b9c50a8602052505060409093208290555092915050565b60006001600160e01b031982166380ac58cd60e01b14806109b657506001600160e01b03198216635b5e139f60e01b145b806109d157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600060088361271081106109ed576109ed6129e2565b620186aa0201600901826127108110610a0857610a086129e2565b600a020160405180610140016040529081600082015481526020016001820154815260200160028201548152602001600382018054610a46906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a72906129f8565b8015610abf5780601f10610a9457610100808354040283529160200191610abf565b820191906000526020600020905b815481529060010190602001808311610aa257829003601f168201915b50505050508152602001600482018054610ad8906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610b04906129f8565b8015610b515780601f10610b2657610100808354040283529160200191610b51565b820191906000526020600020905b815481529060010190602001808311610b3457829003601f168201915b50505050508152602001600582018054610b6a906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610b96906129f8565b8015610be35780601f10610bb857610100808354040283529160200191610be3565b820191906000526020600020905b815481529060010190602001808311610bc657829003601f168201915b505050918352505060068201546001600160a01b0316602080830191909152600783015460408301526008830154606083015260099092015460ff161515608090910152810151909150610c38868683610ed7565b846008856127108110610c4d57610c4d6129e2565b620186aa0201600901846127108110610c6857610c686129e2565b600a020160060160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050505050565b606060008054610caa906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd6906129f8565b8015610d235780601f10610cf857610100808354040283529160200191610d23565b820191906000526020600020905b815481529060010190602001808311610d0657829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610da65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105e6565b506000908152600460205260409020546001600160a01b031690565b6000610dcd82610f23565b9050806001600160a01b0316836001600160a01b031603610e3a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105e6565b336001600160a01b0382161480610e565750610e568133610323565b610ec85760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105e6565b610ed28383611d35565b505050565b610ee13382611da3565b610efd5760405162461bcd60e51b81526004016105e690612bb5565b610ed2838383611e9a565b610ed283838360405180602001604052806000815250611736565b6000818152600260205260408120546001600160a01b0316806109d15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105e6565b60408051602080825281830190925260609160208201818036833750505060208101929092525090565b60006001600160a01b03821661102f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105e6565b506001600160a01b031660009081526003602052604090205490565b6060600061105883610f9a565b9392505050565b606060018054610caa906129f8565b61107933838361203a565b5050565b604080516101408101825260008082526020820181905291810182905260608082018190526080820181905260a082015260c0810182905260e08101829052610100810182905261012081018290529060088461271081106110e1576110e16129e2565b620186aa02016009018361271081106110fc576110fc6129e2565b600a02016040518061014001604052908160008201548152602001600182015481526020016002820154815260200160038201805461113a906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611166906129f8565b80156111b35780601f10611188576101008083540402835291602001916111b3565b820191906000526020600020905b81548152906001019060200180831161119657829003601f168201915b505050505081526020016004820180546111cc906129f8565b80601f01602080910402602001604051908101604052809291908181526020018280546111f8906129f8565b80156112455780601f1061121a57610100808354040283529160200191611245565b820191906000526020600020905b81548152906001019060200180831161122857829003601f168201915b5050505050815260200160058201805461125e906129f8565b80601f016020809104026020016040519081016040528092919081815260200182805461128a906129f8565b80156112d75780601f106112ac576101008083540402835291602001916112d7565b820191906000526020600020905b8154815290600101906020018083116112ba57829003601f168201915b505050918352505060068201546001600160a01b03166020820152600782015460408201526008820154606082015260099091015460ff1615156080909101526101208101519091506110585760008361133386612710612b8b565b61133d9190612ba2565b9050600060028260405160200161135691815260200190565b60408051601f198184030181529082905261137091612a32565b602060405180830381855afa15801561138d573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906113b09190612a4e565b604080516101408101825287815260006020808301829052828401829052835180820185528281526060840152835180820185528281526080840152835190810190935280835260a082019290925260c0810182905260e08101929092526101008201889052610120820152925050509392505050565b6000808260008151811061143d5761143d6129e2565b6020026020010151905060008360018151811061145c5761145c6129e2565b6020026020010151905060008460028151811061147b5761147b6129e2565b6020026020010151905060008560038151811061149a5761149a6129e2565b602002602001015190506000866004815181106114b9576114b96129e2565b60200260200101519050600060088961271081106114d9576114d96129e2565b620186aa0201905080620186a90160009054906101000a900460ff16156114ff57600080fd5b600060028a60405160200161151691815260200190565b60408051601f198184030181529082905261153091612a32565b602060405180830381855afa15801561154d573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906115709190612a4e565b90508660088b6127108110611587576115876129e2565b620186aa0201906115989082612ab5565b508a60088b61271081106115ae576115ae6129e2565b620186aa0201600101819055508960088b61271081106115d0576115d06129e2565b620186aa0201600201819055508060088b61271081106115f2576115f26129e2565b620186aa0201600301819055508560088b6127108110611614576116146129e2565b620186aa020160040190816116299190612ab5565b503360088b612710811061163f5761163f6129e2565b620186aa020160050160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508460088b6127108110611681576116816129e2565b620186aa020160060190816116969190612ab5565b508360088b61271081106116ac576116ac6129e2565b620186aa020160070190816116c19190612ab5565b508260088b61271081106116d7576116d76129e2565b620186aa020160080190816116ec9190612ab5565b50600160088b6127108110611703576117036129e2565b620186aa0201620186a90160006101000a81548160ff021916908315150217905550899750505050505050509392505050565b6117403383611da3565b61175c5760405162461bcd60e51b81526004016105e690612bb5565b61176884848484612108565b50505050565b6117c9604051806101200160405280606081526020016000815260200160008152602001600080191681526020016060815260200160006001600160a01b031681526020016060815260200160608152602001606081525090565b600060088361271081106117df576117df6129e2565b620186aa020190506000604051806101200160405280836000018054611804906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611830906129f8565b801561187d5780601f106118525761010080835404028352916020019161187d565b820191906000526020600020905b81548152906001019060200180831161186057829003601f168201915b505050505081526020018360010154815260200183600201548152602001836003015481526020018360040180546118b4906129f8565b80601f01602080910402602001604051908101604052809291908181526020018280546118e0906129f8565b801561192d5780601f106119025761010080835404028352916020019161192d565b820191906000526020600020905b81548152906001019060200180831161191057829003601f168201915b505050918352505060058401546001600160a01b0316602082015260068401805460409092019161195d906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611989906129f8565b80156119d65780601f106119ab576101008083540402835291602001916119d6565b820191906000526020600020905b8154815290600101906020018083116119b957829003601f168201915b505050505081526020018360070180546119ef906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1b906129f8565b8015611a685780601f10611a3d57610100808354040283529160200191611a68565b820191906000526020600020905b815481529060010190602001808311611a4b57829003601f168201915b50505050508152602001836008018054611a81906129f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611aad906129f8565b8015611afa5780601f10611acf57610100808354040283529160200191611afa565b820191906000526020600020905b815481529060010190602001808311611add57829003601f168201915b50505091909252509095945050505050565b6000818152600260205260409020546060906001600160a01b0316611b8b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016105e6565b6000611ba260408051602081019091526000815290565b90506000815111611bc25760405180602001604052806000815250611058565b80611bcc8461213b565b604051602001611bdd929190612c06565b6040516020818303038152906040529392505050565b6001600160a01b038216611c495760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105e6565b6000818152600260205260409020546001600160a01b031615611cae5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105e6565b6001600160a01b0382166000908152600360205260408120805460019290611cd7908490612ba2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d6a82610f23565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316611e1c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105e6565b6000611e2783610f23565b9050806001600160a01b0316846001600160a01b03161480611e625750836001600160a01b0316611e5784610d2d565b6001600160a01b0316145b80611e9257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611ead82610f23565b6001600160a01b031614611f155760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016105e6565b6001600160a01b038216611f775760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105e6565b611f82600082611d35565b6001600160a01b0383166000908152600360205260408120805460019290611fab908490612c35565b90915550506001600160a01b0382166000908152600360205260408120805460019290611fd9908490612ba2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b816001600160a01b0316836001600160a01b03160361209b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105e6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612113848484611e9a565b61211f8484848461223c565b6117685760405162461bcd60e51b81526004016105e690612c48565b6060816000036121625750506040805180820190915260018152600360fc1b602082015290565b8160005b811561218c578061217681612c9a565b91506121859050600a83612cc9565b9150612166565b60008167ffffffffffffffff8111156121a7576121a7612359565b6040519080825280601f01601f1916602001820160405280156121d1576020820181803683370190505b5090505b8415611e92576121e6600183612c35565b91506121f3600a86612cdd565b6121fe906030612ba2565b60f81b818381518110612213576122136129e2565b60200101906001600160f81b031916908160001a905350612235600a86612cc9565b94506121d5565b60006001600160a01b0384163b1561233257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612280903390899088908890600401612cf1565b6020604051808303816000875af19250505080156122bb575060408051601f3d908101601f191682019092526122b891810190612d24565b60015b612318573d8080156122e9576040519150601f19603f3d011682016040523d82523d6000602084013e6122ee565b606091505b5080516000036123105760405162461bcd60e51b81526004016105e690612c48565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e92565b506001949350505050565b80356001600160a01b038116811461235457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561239857612398612359565b604052919050565b600067ffffffffffffffff8311156123ba576123ba612359565b6123cd601f8401601f191660200161236f565b90508281528383830111156123e157600080fd5b828260208301376000602084830101529392505050565b600082601f83011261240957600080fd5b611058838335602085016123a0565b600080600080600080600060e0888a03121561243357600080fd5b61243c8861233d565b96506020880135955060408801359450606088013567ffffffffffffffff8082111561246757600080fd5b6124738b838c016123f8565b955060808a013591508082111561248957600080fd5b6124958b838c016123f8565b945060a08a01359150808211156124ab57600080fd5b6124b78b838c016123f8565b935060c08a01359150808211156124cd57600080fd5b506124da8a828b016123f8565b91505092959891949750929550565b6001600160e01b0319811681146124ff57600080fd5b50565b60006020828403121561251457600080fd5b8135611058816124e9565b6000806000806080858703121561253557600080fd5b61253e8561233d565b935061254c6020860161233d565b93969395505050506040820135916060013590565b60005b8381101561257c578181015183820152602001612564565b50506000910152565b6000815180845261259d816020860160208601612561565b601f01601f19169290920160200192915050565b6020815260006110586020830184612585565b6000602082840312156125d657600080fd5b5035919050565b600080604083850312156125f057600080fd5b6125f98361233d565b946020939093013593505050565b60008060006060848603121561261c57600080fd5b6126258461233d565b92506126336020850161233d565b9150604084013590509250925092565b60006020828403121561265557600080fd5b6110588261233d565b6000806040838503121561267157600080fd5b61267a8361233d565b91506020830135801515811461268f57600080fd5b809150509250929050565b600080604083850312156126ad57600080fd5b50508035926020909101359150565b60208152815160208201526020820151604082015260408201516060820152600060608301516101408060808501526126f9610160850183612585565b91506080850151601f19808685030160a08701526127178483612585565b935060a08701519150808685030160c0870152506127358382612585565b92505060c085015161275260e08601826001600160a01b03169052565b5060e085015161010085810191909152850151610120808601919091529094015115159390920192909252919050565b60008060006060848603121561279757600080fd5b833592506020808501359250604085013567ffffffffffffffff808211156127be57600080fd5b818701915087601f8301126127d257600080fd5b8135818111156127e4576127e4612359565b8060051b6127f385820161236f565b918252838101850191858101908b84111561280d57600080fd5b86860192505b838310156128495782358581111561282b5760008081fd5b6128398d89838a01016123f8565b8352509186019190860190612813565b809750505050505050509250925092565b6000806000806080858703121561287057600080fd5b6128798561233d565b93506128876020860161233d565b925060408501359150606085013567ffffffffffffffff8111156128aa57600080fd5b8501601f810187136128bb57600080fd5b6128ca878235602084016123a0565b91505092959194509250565b60208152600082516101208060208501526128f5610140850183612585565b91506020850151604085015260408501516060850152606085015160808501526080850151601f19808685030160a08701526129318483612585565b935060a0870151915061294f60c08701836001600160a01b03169052565b60c08701519150808685030160e087015261296a8483612585565b935060e087015191506101008187860301818801526129898584612585565b9088015187820390920184880152935090506129a58382612585565b9695505050505050565b600080604083850312156129c257600080fd5b6129cb8361233d565b91506129d96020840161233d565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612a0c57607f821691505b602082108103612a2c57634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612a44818460208701612561565b9190910192915050565b600060208284031215612a6057600080fd5b5051919050565b601f821115610ed257600081815260208120601f850160051c81016020861015612a8e5750805b601f850160051c820191505b81811015612aad57828155600101612a9a565b505050505050565b815167ffffffffffffffff811115612acf57612acf612359565b612ae381612add84546129f8565b84612a67565b602080601f831160018114612b185760008415612b005750858301515b600019600386901b1c1916600185901b178555612aad565b600085815260208120601f198616915b82811015612b4757888601518255948401946001909101908401612b28565b5085821015612b655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176109d1576109d1612b75565b808201808211156109d1576109d1612b75565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60008351612c18818460208801612561565b835190830190612c2c818360208801612561565b01949350505050565b818103818111156109d1576109d1612b75565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060018201612cac57612cac612b75565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082612cd857612cd8612cb3565b500490565b600082612cec57612cec612cb3565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906129a590830184612585565b600060208284031215612d3657600080fd5b8151611058816124e956fea2646970667358221220635f7d479b290ba63346d4c479d2e848185a2b500d7ad8c95eb700440ab5fe6064736f6c63430008110033";

    public static final String FUNC_APPROVE = "approve";

    public static final String FUNC_BALANCEOF = "balanceOf";

    public static final String FUNC_CURRENTTOKENINDEX = "currentTokenIndex";

    public static final String FUNC_GETAPPROVED = "getApproved";

    public static final String FUNC_ISAPPROVEDFORALL = "isApprovedForAll";

    public static final String FUNC_NAME = "name";

    public static final String FUNC_OWNEROF = "ownerOf";

    public static final String FUNC_PRODUCTINFO = "productInfo";

    public static final String FUNC_PUBLISH = "publish";

    public static final String FUNC_QUERYTOKEN = "queryToken";

    public static final String FUNC_safeTransferFrom = "safeTransferFrom";

    public static final String FUNC_SENDTO = "sendTo";

    public static final String FUNC_SETAPPROVALFORALL = "setApprovalForAll";

    public static final String FUNC_SUPPORTSINTERFACE = "supportsInterface";

    public static final String FUNC_SYMBOL = "symbol";

    public static final String FUNC_TOBYTESNICKJOHNSON = "toBytesNickJohnson";

    public static final String FUNC_TOSTR = "toStr";

    public static final String FUNC_TOKENURI = "tokenURI";

    public static final String FUNC_TRANSFERFROM = "transferFrom";

    public static final String FUNC_TRANSFERTOKEN = "transferToken";

    public static final Event APPROVAL_EVENT = new Event("Approval", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint256>(true) {}));
    ;

    public static final Event APPROVALFORALL_EVENT = new Event("ApprovalForAll", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Bool>() {}));
    ;

    public static final Event TRANSFER_EVENT = new Event("Transfer", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint256>(true) {}));
    ;

    @Deprecated
    protected Dart(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected Dart(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected Dart(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected Dart(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public List<ApprovalEventResponse> getApprovalEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(APPROVAL_EVENT, transactionReceipt);
        ArrayList<ApprovalEventResponse> responses = new ArrayList<ApprovalEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            ApprovalEventResponse typedResponse = new ApprovalEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.approved = (String) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.tokenId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public Flowable<ApprovalEventResponse> approvalEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(new Function<Log, ApprovalEventResponse>() {
            @Override
            public ApprovalEventResponse apply(Log log) {
                Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVAL_EVENT, log);
                ApprovalEventResponse typedResponse = new ApprovalEventResponse();
                typedResponse.log = log;
                typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue();
                typedResponse.approved = (String) eventValues.getIndexedValues().get(1).getValue();
                typedResponse.tokenId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
                return typedResponse;
            }
        });
    }

    public Flowable<ApprovalEventResponse> approvalEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT));
        return approvalEventFlowable(filter);
    }

    public List<ApprovalForAllEventResponse> getApprovalForAllEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(APPROVALFORALL_EVENT, transactionReceipt);
        ArrayList<ApprovalForAllEventResponse> responses = new ArrayList<ApprovalForAllEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            ApprovalForAllEventResponse typedResponse = new ApprovalForAllEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.operator = (String) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.approved = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public Flowable<ApprovalForAllEventResponse> approvalForAllEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(new Function<Log, ApprovalForAllEventResponse>() {
            @Override
            public ApprovalForAllEventResponse apply(Log log) {
                Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVALFORALL_EVENT, log);
                ApprovalForAllEventResponse typedResponse = new ApprovalForAllEventResponse();
                typedResponse.log = log;
                typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue();
                typedResponse.operator = (String) eventValues.getIndexedValues().get(1).getValue();
                typedResponse.approved = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
                return typedResponse;
            }
        });
    }

    public Flowable<ApprovalForAllEventResponse> approvalForAllEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(APPROVALFORALL_EVENT));
        return approvalForAllEventFlowable(filter);
    }

    public List<TransferEventResponse> getTransferEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt);
        ArrayList<TransferEventResponse> responses = new ArrayList<TransferEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            TransferEventResponse typedResponse = new TransferEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.tokenId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public Flowable<TransferEventResponse> transferEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(new Function<Log, TransferEventResponse>() {
            @Override
            public TransferEventResponse apply(Log log) {
                Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log);
                TransferEventResponse typedResponse = new TransferEventResponse();
                typedResponse.log = log;
                typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();
                typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
                typedResponse.tokenId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
                return typedResponse;
            }
        });
    }

    public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT));
        return transferEventFlowable(filter);
    }

    public RemoteFunctionCall<TransactionReceipt> approve(String to, BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_APPROVE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> balanceOf(String owner) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_BALANCEOF, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, owner)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> currentTokenIndex(BigInteger param0) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_CURRENTTOKENINDEX, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(param0)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<String> getApproved(BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_GETAPPROVED, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<Boolean> isApprovedForAll(String owner, String operator) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_ISAPPROVEDFORALL, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, owner), 
                new org.web3j.abi.datatypes.Address(160, operator)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<String> name() {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_NAME, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<String> ownerOf(BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_OWNEROF, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<ProductView> productInfo(BigInteger pIndex) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_PRODUCTINFO, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(pIndex)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<ProductView>() {}));
        return executeRemoteCallSingleValueReturn(function, ProductView.class);
    }

    public RemoteFunctionCall<TransactionReceipt> publish(BigInteger totalSupply, BigInteger productIndex, List<String> params) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_PUBLISH, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(totalSupply), 
                new org.web3j.abi.datatypes.generated.Uint256(productIndex), 
                new org.web3j.abi.datatypes.DynamicArray<org.web3j.abi.datatypes.Utf8String>(
                        org.web3j.abi.datatypes.Utf8String.class,
                        org.web3j.abi.Utils.typeMap(params, org.web3j.abi.datatypes.Utf8String.class))), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Data> queryToken(BigInteger pIndex, BigInteger index) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_QUERYTOKEN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(pIndex), 
                new org.web3j.abi.datatypes.generated.Uint256(index)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Data>() {}));
        return executeRemoteCallSingleValueReturn(function, Data.class);
    }

    public RemoteFunctionCall<TransactionReceipt> safeTransferFrom(String from, String to, BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_safeTransferFrom, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, from), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> safeTransferFrom(String from, String to, BigInteger tokenId, byte[] _data) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_safeTransferFrom, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, from), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenId), 
                new org.web3j.abi.datatypes.DynamicBytes(_data)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> sendTo(String player, BigInteger productIndex, BigInteger tokenIndex, String card, String userName, String price, String time) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_SENDTO, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, player), 
                new org.web3j.abi.datatypes.generated.Uint256(productIndex), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenIndex), 
                new org.web3j.abi.datatypes.Utf8String(card), 
                new org.web3j.abi.datatypes.Utf8String(userName), 
                new org.web3j.abi.datatypes.Utf8String(price), 
                new org.web3j.abi.datatypes.Utf8String(time)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setApprovalForAll(String operator, Boolean approved) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_SETAPPROVALFORALL, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, operator), 
                new org.web3j.abi.datatypes.Bool(approved)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> supportsInterface(byte[] interfaceId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_SUPPORTSINTERFACE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes4(interfaceId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<String> symbol() {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_SYMBOL, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<byte[]> toBytesNickJohnson(BigInteger x) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_TOBYTESNICKJOHNSON, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(x)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicBytes>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<String> toStr(BigInteger playChoice) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_TOSTR, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(playChoice)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<String> tokenURI(BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(FUNC_TOKENURI, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<TransactionReceipt> transferFrom(String from, String to, BigInteger tokenId) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_TRANSFERFROM, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, from), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> transferToken(String from, String to, BigInteger productIndex, BigInteger tokenIndex) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_TRANSFERTOKEN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, from), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(productIndex), 
                new org.web3j.abi.datatypes.generated.Uint256(tokenIndex)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static Dart load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new Dart(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static Dart load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new Dart(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static Dart load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new Dart(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static Dart load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new Dart(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<Dart> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String name, String symbol) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(name), 
                new org.web3j.abi.datatypes.Utf8String(symbol)));
        return deployRemoteCall(Dart.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
    }

    public static RemoteCall<Dart> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String name, String symbol) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(name), 
                new org.web3j.abi.datatypes.Utf8String(symbol)));
        return deployRemoteCall(Dart.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<Dart> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String name, String symbol) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(name), 
                new org.web3j.abi.datatypes.Utf8String(symbol)));
        return deployRemoteCall(Dart.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<Dart> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String name, String symbol) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(name), 
                new org.web3j.abi.datatypes.Utf8String(symbol)));
        return deployRemoteCall(Dart.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor);
    }

    public static class ProductView extends DynamicStruct {
        public String name;

        public BigInteger totalSupply;

        public BigInteger index;

        public byte[] id;

        public String desc;

        public String owner;

        public String publishName;

        public String publishTime;

        public String authority;

        public ProductView(String name, BigInteger totalSupply, BigInteger index, byte[] id, String desc, String owner, String publishName, String publishTime, String authority) {
            super(new org.web3j.abi.datatypes.Utf8String(name),new org.web3j.abi.datatypes.generated.Uint256(totalSupply),new org.web3j.abi.datatypes.generated.Uint256(index),new org.web3j.abi.datatypes.generated.Bytes32(id),new org.web3j.abi.datatypes.Utf8String(desc),new org.web3j.abi.datatypes.Address(owner),new org.web3j.abi.datatypes.Utf8String(publishName),new org.web3j.abi.datatypes.Utf8String(publishTime),new org.web3j.abi.datatypes.Utf8String(authority));
            this.name = name;
            this.totalSupply = totalSupply;
            this.index = index;
            this.id = id;
            this.desc = desc;
            this.owner = owner;
            this.publishName = publishName;
            this.publishTime = publishTime;
            this.authority = authority;
        }

        public ProductView(Utf8String name, Uint256 totalSupply, Uint256 index, Bytes32 id, Utf8String desc, Address owner, Utf8String publishName, Utf8String publishTime, Utf8String authority) {
            super(name,totalSupply,index,id,desc,owner,publishName,publishTime,authority);
            this.name = name.getValue();
            this.totalSupply = totalSupply.getValue();
            this.index = index.getValue();
            this.id = id.getValue();
            this.desc = desc.getValue();
            this.owner = owner.getValue();
            this.publishName = publishName.getValue();
            this.publishTime = publishTime.getValue();
            this.authority = authority.getValue();
        }
    }

    public static class Data extends DynamicStruct {
        public BigInteger currentIndex;

        public BigInteger tokenId;

        public byte[] cardHash;

        public String userName;

        public String price;

        public String time;

        public String owner;

        public byte[] id;

        public BigInteger productIndex;

        public Boolean valid;

        public Data(BigInteger currentIndex, BigInteger tokenId, byte[] cardHash, String userName, String price, String time, String owner, byte[] id, BigInteger productIndex, Boolean valid) {
            super(new org.web3j.abi.datatypes.generated.Uint256(currentIndex),new org.web3j.abi.datatypes.generated.Uint256(tokenId),new org.web3j.abi.datatypes.generated.Bytes32(cardHash),new org.web3j.abi.datatypes.Utf8String(userName),new org.web3j.abi.datatypes.Utf8String(price),new org.web3j.abi.datatypes.Utf8String(time),new org.web3j.abi.datatypes.Address(owner),new org.web3j.abi.datatypes.generated.Bytes32(id),new org.web3j.abi.datatypes.generated.Uint256(productIndex),new org.web3j.abi.datatypes.Bool(valid));
            this.currentIndex = currentIndex;
            this.tokenId = tokenId;
            this.cardHash = cardHash;
            this.userName = userName;
            this.price = price;
            this.time = time;
            this.owner = owner;
            this.id = id;
            this.productIndex = productIndex;
            this.valid = valid;
        }

        public Data(Uint256 currentIndex, Uint256 tokenId, Bytes32 cardHash, Utf8String userName, Utf8String price, Utf8String time, Address owner, Bytes32 id, Uint256 productIndex, Bool valid) {
            super(currentIndex,tokenId,cardHash,userName,price,time,owner,id,productIndex,valid);
            this.currentIndex = currentIndex.getValue();
            this.tokenId = tokenId.getValue();
            this.cardHash = cardHash.getValue();
            this.userName = userName.getValue();
            this.price = price.getValue();
            this.time = time.getValue();
            this.owner = owner.getValue();
            this.id = id.getValue();
            this.productIndex = productIndex.getValue();
            this.valid = valid.getValue();
        }
    }

    public static class ApprovalEventResponse extends BaseEventResponse {
        public String owner;

        public String approved;

        public BigInteger tokenId;
    }

    public static class ApprovalForAllEventResponse extends BaseEventResponse {
        public String owner;

        public String operator;

        public Boolean approved;
    }

    public static class TransferEventResponse extends BaseEventResponse {
        public String from;

        public String to;

        public BigInteger tokenId;
    }
}

 

参考: 将solidity智能合约打包成Java代码_

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值