├── .idea ├── .gitignore ├── compiler.xml ├── encodings.xml ├── jarRepositories.xml ├── libraries │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ ├── Maven__com_alibaba_fastjson_1_2_62.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_11_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_11_0.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_0.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_0.xml │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_0.xml │ ├── Maven__com_github_jnr_jffi_1_2_17.xml │ ├── Maven__com_github_jnr_jffi_native_1_2_16.xml │ ├── Maven__com_github_jnr_jnr_a64asm_1_0_0.xml │ ├── Maven__com_github_jnr_jnr_constants_0_9_11.xml │ ├── Maven__com_github_jnr_jnr_enxio_0_19.xml │ ├── Maven__com_github_jnr_jnr_ffi_2_1_9.xml │ ├── Maven__com_github_jnr_jnr_posix_3_0_47.xml │ ├── Maven__com_github_jnr_jnr_unixsocket_0_21.xml │ ├── Maven__com_github_jnr_jnr_x86asm_1_0_2.xml │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ ├── Maven__com_squareup_okhttp3_logging_interceptor_3_14_8.xml │ ├── Maven__com_squareup_okhttp3_okhttp_3_14_8.xml │ ├── Maven__com_squareup_okio_okio_1_17_2.xml │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ ├── Maven__io_reactivex_rxjava2_rxjava_2_2_19.xml │ ├── Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml │ ├── Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml │ ├── Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml │ ├── Maven__junit_junit_4_13.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_10_10.xml │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_10_10.xml │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ ├── Maven__net_minidev_json_smart_2_3.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_13_2.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_2.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_35.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_35.xml │ ├── Maven__org_apiguardian_apiguardian_api_1_1_0.xml │ ├── Maven__org_aspectj_aspectjweaver_1_9_5.xml │ ├── Maven__org_assertj_assertj_core_3_16_1.xml │ ├── Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml │ ├── Maven__org_bouncycastle_bcprov_jdk15on_1_61.xml │ ├── Maven__org_glassfish_jakarta_el_3_0_3.xml │ ├── Maven__org_hamcrest_hamcrest_2_2.xml │ ├── Maven__org_java_websocket_Java_WebSocket_1_3_8.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_5_6_2.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_api_5_6_2.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_engine_5_6_2.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_params_5_6_2.xml │ ├── Maven__org_junit_platform_junit_platform_commons_1_6_2.xml │ ├── Maven__org_junit_platform_junit_platform_engine_1_6_2.xml │ ├── Maven__org_junit_vintage_junit_vintage_engine_5_6_2.xml │ ├── Maven__org_mockito_mockito_core_3_3_3.xml │ ├── Maven__org_mockito_mockito_junit_jupiter_3_3_3.xml │ ├── Maven__org_objenesis_objenesis_2_6.xml │ ├── Maven__org_opentest4j_opentest4j_1_2_0.xml │ ├── Maven__org_ow2_asm_asm_5_0_3.xml │ ├── Maven__org_ow2_asm_asm_analysis_5_0_3.xml │ ├── Maven__org_ow2_asm_asm_commons_5_0_3.xml │ ├── Maven__org_ow2_asm_asm_tree_5_0_3.xml │ ├── Maven__org_ow2_asm_asm_util_5_0_3.xml │ ├── Maven__org_projectlombok_lombok_1_18_12.xml │ ├── Maven__org_reactivestreams_reactive_streams_1_0_3.xml │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_30.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_30.xml │ ├── Maven__org_springframework_boot_spring_boot_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_3_0_RELEASE.xml │ ├── Maven__org_springframework_spring_aop_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_context_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_core_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_expression_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_test_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_2_6_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_5_2_6_RELEASE.xml │ ├── Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml │ ├── Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml │ ├── Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml │ ├── Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml │ ├── Maven__org_web3j_abi_4_5_11.xml │ ├── Maven__org_web3j_core_4_5_11.xml │ ├── Maven__org_web3j_crypto_4_5_11.xml │ ├── Maven__org_web3j_rlp_4_5_11.xml │ ├── Maven__org_web3j_tuples_4_5_11.xml │ ├── Maven__org_web3j_utils_4_5_11.xml │ ├── Maven__org_xmlunit_xmlunit_core_2_7_0.xml │ └── Maven__org_yaml_snakeyaml_1_26.xml ├── misc.xml ├── modules.xml ├── uiDesigner.xml └── vcs.xml ├── CrowdFunding.iml ├── README.md ├── docs ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── pom.xml └── src ├── main ├── java │ ├── com │ │ └── example │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── base │ │ │ ├── LogAspect.java │ │ │ ├── Result.java │ │ │ ├── Status.java │ │ │ └── Utils.java │ │ │ ├── config │ │ │ └── Web3jConfig.java │ │ │ ├── controller │ │ │ ├── IndexController.java │ │ │ └── SponsorController.java │ │ │ └── model │ │ │ ├── Campaign.java │ │ │ └── Funder.java │ └── org │ │ └── web3j │ │ └── model │ │ └── CrowdFunding.java └── resources │ ├── CrowdFunding.sol │ ├── application.properties │ ├── static │ ├── css │ │ └── bootstrap.min.css │ └── js │ │ ├── bootstrap.min.js │ │ └── jquery.min.js │ └── templates │ ├── contribute.html │ ├── create.html │ └── index.html └── test └── java └── com └── example └── demo └── ContractDeploy.java /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_62.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jffi_1_2_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jffi_native_1_2_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_a64asm_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_constants_0_9_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_enxio_0_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_ffi_2_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_posix_3_0_47.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_unixsocket_0_21.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jnr_jnr_x86asm_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okhttp3_logging_interceptor_3_14_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okhttp3_okhttp_3_14_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okio_okio_1_17_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_2_2_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__junit_junit_4_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_35.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_35.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_assertj_assertj_core_3_16_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15on_1_61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_glassfish_jakarta_el_3_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_java_websocket_Java_WebSocket_1_3_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_vintage_junit_vintage_engine_5_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_core_3_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_analysis_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_commons_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_tree_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_util_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_projectlombok_lombok_1_18_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_30.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_3_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_abi_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_core_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_crypto_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_rlp_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_tuples_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_web3j_utils_4_5_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CrowdFunding.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 以太坊众筹系统 2 | :smile: 更新版本,支持插件。 3 | 4 | ![alt text](docs/1.png) 5 | 6 | ![alt text](docs/2.png) 7 | 8 | ![alt text](docs/3.png) 9 | 10 | ![alt text](docs/4.png) 11 | 12 | ## Hello World 13 | 学前班:https://github.com/littleredhat1997/Ethereum 14 | 15 | 如果不想本地搭建,可以使用公开测试网络: 16 | >* https://ropsten.infura.io/ 17 | >* https://rinkeby.infura.io 18 | >* https://kovan.infura.io 19 | 20 | ## 运行插件 21 | Plugins->web3j:generate-sources 22 | ``` 23 | resources/CrowdFunding.sol ----> org.web3j.model.CrowdFunding 24 | ``` 25 | 26 | ## 部署合约 27 | test/java/com/example/demo/ContractDeploy.java 28 | ``` 29 | CrowdFunding contract = CrowdFunding.deploy(web3j, credentials, new DefaultGasProvider()).send(); 30 | System.out.println(contract.getContractAddress()); 31 | // rewrite: contractAddress ----> application.properties 32 | ``` 33 | 34 | ## 启动项目 35 | main/java/com/example/demo/Application.java 36 | 37 | http://localhost:8080/ 38 | 39 | 注意:记得挖矿,等待确认! -------------------------------------------------------------------------------- /docs/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangbincheng1997/CrowdFunding/bc23c1a9260045dc4943ef379f7c8b6573a91678/docs/1.png -------------------------------------------------------------------------------- /docs/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangbincheng1997/CrowdFunding/bc23c1a9260045dc4943ef379f7c8b6573a91678/docs/2.png -------------------------------------------------------------------------------- /docs/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangbincheng1997/CrowdFunding/bc23c1a9260045dc4943ef379f7c8b6573a91678/docs/3.png -------------------------------------------------------------------------------- /docs/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangbincheng1997/CrowdFunding/bc23c1a9260045dc4943ef379f7c8b6573a91678/docs/4.png -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.0.RELEASE 9 | 10 | 11 | com.example 12 | demo 13 | 0.0.1-SNAPSHOT 14 | demo 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-thymeleaf 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-aop 41 | 42 | 43 | 44 | org.projectlombok 45 | lombok 46 | true 47 | 48 | 49 | 50 | org.web3j 51 | core 52 | 4.5.11 53 | 54 | 55 | 56 | com.alibaba 57 | fastjson 58 | 1.2.62 59 | 60 | 61 | 62 | 63 | ${project.name} 64 | 65 | 66 | org.springframework.boot 67 | spring-boot-maven-plugin 68 | 69 | 70 | org.web3j 71 | web3j-maven-plugin 72 | 4.5.11 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/base/LogAspect.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.base; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.aspectj.lang.ProceedingJoinPoint; 6 | import org.aspectj.lang.annotation.Around; 7 | import org.aspectj.lang.annotation.Aspect; 8 | import org.aspectj.lang.annotation.Pointcut; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.context.request.RequestAttributes; 11 | import org.springframework.web.context.request.RequestContextHolder; 12 | import org.springframework.web.context.request.ServletRequestAttributes; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | 16 | @Slf4j 17 | @Aspect 18 | @Component 19 | public class LogAspect { 20 | 21 | // 定义切点 22 | @Pointcut("execution(* com.example.demo.controller.*Controller.*(..))") 23 | public void excudeService() { 24 | } 25 | 26 | @Around("excudeService()") 27 | public Object doAround(ProceedingJoinPoint pjp) throws Throwable { 28 | RequestAttributes ra = RequestContextHolder.getRequestAttributes(); 29 | ServletRequestAttributes sra = (ServletRequestAttributes) ra; 30 | HttpServletRequest request = sra.getRequest(); 31 | 32 | String uri = request.getRequestURI(); 33 | String method = request.getMethod(); 34 | String params = JSON.toJSONString(request.getParameterMap()); 35 | log.info("***************************************************"); 36 | log.info("请求开始 | URI: {}, method: {}, params: {}", uri, method, params); 37 | 38 | Long start = System.currentTimeMillis(); 39 | Object result = pjp.proceed(); 40 | Long end = System.currentTimeMillis(); 41 | 42 | log.info("请求结束 | " + JSON.toJSONString(result)); 43 | log.info("time: {}ms", end - start); 44 | return result; 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/example/demo/base/Result.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.base; 2 | 3 | /** 4 | * API格式封装 5 | */ 6 | public class Result { 7 | 8 | private int code; 9 | private String message; 10 | private Object data; 11 | 12 | public Result(int code, String message, Object data) { 13 | this.code = code; 14 | this.message = message; 15 | this.data = data; 16 | } 17 | 18 | public Result() { 19 | this.code = Status.SUCCESS.getCode(); 20 | this.message = Status.SUCCESS.getMessage(); 21 | } 22 | 23 | public int getCode() { 24 | return code; 25 | } 26 | 27 | public void setCode(int code) { 28 | this.code = code; 29 | } 30 | 31 | public String getMessage() { 32 | return message; 33 | } 34 | 35 | public void setMessage(String message) { 36 | this.message = message; 37 | } 38 | 39 | public Object getData() { 40 | return data; 41 | } 42 | 43 | public void setData(Object data) { 44 | this.data = data; 45 | } 46 | 47 | public static Result message(int code, String message) { 48 | return new Result(code, message, null); 49 | } 50 | 51 | public static Result error(Status status) { 52 | return new Result(status.getCode(), status.getMessage(), null); 53 | } 54 | 55 | public static Result success(Object data) { 56 | return new Result(Status.SUCCESS.getCode(), Status.SUCCESS.getMessage(), data); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/base/Status.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.base; 2 | 3 | public enum Status { 4 | SUCCESS(200, "OK"), 5 | ETH_ERROR(1000, "以太坊错误"); 6 | 7 | private int code; 8 | private String message; 9 | 10 | Status(int code, String message) { 11 | this.code = code; 12 | this.message = message; 13 | } 14 | 15 | public int getCode() { 16 | return code; 17 | } 18 | 19 | public void setCode(int code) { 20 | this.code = code; 21 | } 22 | 23 | public String getMessage() { 24 | return message; 25 | } 26 | 27 | public void setMessage(String message) { 28 | this.message = message; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/base/Utils.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.base; 2 | 3 | import java.io.*; 4 | 5 | public class Utils { 6 | private static final String PREFIX = "key"; 7 | private static final String SUFFIX = ".tmp"; 8 | 9 | /** 10 | * 临时文件 11 | * 12 | * @param content 13 | * @return 14 | */ 15 | public static File StoreTmpFile(byte[] content) { 16 | File tmp = null; 17 | try { 18 | tmp = File.createTempFile(PREFIX, SUFFIX); 19 | tmp.deleteOnExit(); 20 | BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tmp)); 21 | out.write(content); 22 | out.close(); 23 | } catch (IOException e) { 24 | e.printStackTrace(); 25 | } 26 | return tmp; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/config/Web3jConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | import org.web3j.crypto.Credentials; 9 | import org.web3j.crypto.WalletUtils; 10 | import org.web3j.model.CrowdFunding; 11 | import org.web3j.protocol.Web3j; 12 | import org.web3j.protocol.http.HttpService; 13 | import org.web3j.tx.gas.DefaultGasProvider; 14 | 15 | @Slf4j 16 | @Configuration 17 | public class Web3jConfig { 18 | 19 | @Value("${web3j.url}") 20 | private String URL; 21 | 22 | @Value("${credentials.source}") 23 | private String SOURCE; 24 | 25 | @Value("${credentials.password}") 26 | private String PASSWORD; 27 | 28 | @Value("${contract.address}") 29 | private String ADDRESS; 30 | 31 | @Bean 32 | public Web3j web3j() { 33 | log.info("加载web3j====>:" + URL); 34 | return Web3j.build(new HttpService(URL)); 35 | } 36 | 37 | @Bean 38 | public Credentials credentials() throws Exception { 39 | log.info("加载credentials====>:" + SOURCE); 40 | return WalletUtils.loadCredentials(PASSWORD, SOURCE); 41 | } 42 | 43 | @Bean 44 | public CrowdFunding crowdFunding() throws Exception { 45 | log.info("加载crowdFunding====>:" + ADDRESS); 46 | return CrowdFunding.load(ADDRESS, web3j(), credentials(), new DefaultGasProvider()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.base.Result; 4 | import com.example.demo.base.Status; 5 | import com.example.demo.model.Campaign; 6 | import com.example.demo.model.Funder; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.web3j.model.CrowdFunding; 12 | import org.web3j.tuples.generated.*; 13 | 14 | import java.math.BigInteger; 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | @Slf4j 19 | @Controller 20 | public class IndexController { 21 | 22 | @Autowired 23 | private CrowdFunding crowdFunding; 24 | 25 | @RequestMapping("campaigns") 26 | @ResponseBody 27 | public Result campaigns() { 28 | try { 29 | BigInteger count = crowdFunding.numCampaigns().send(); 30 | List clist = new ArrayList<>(); 31 | for (int i = 0; i < count.intValue(); i++) { 32 | Tuple6 tuple = 33 | crowdFunding.campaigns(BigInteger.valueOf(i)).send(); 34 | Campaign c = new Campaign(tuple); 35 | c.setId(i); 36 | clist.add(c); 37 | } 38 | return Result.success(clist); 39 | } catch (Exception e) { 40 | log.error("", e); 41 | return Result.error(Status.ETH_ERROR); 42 | } 43 | } 44 | 45 | @RequestMapping("funders") 46 | @ResponseBody 47 | public Result funders(@RequestParam("campaignID") int campaignID) { 48 | try { 49 | BigInteger count = crowdFunding.numFunders(BigInteger.valueOf(campaignID)).send(); 50 | List flist = new ArrayList<>(); 51 | for (int i = 0; i < count.intValue(); i++) { 52 | Tuple3 tuple = 53 | crowdFunding.funders(BigInteger.valueOf(campaignID), BigInteger.valueOf(i)).send(); 54 | Funder f = new Funder(tuple); 55 | f.setId(i); 56 | flist.add(f); 57 | } 58 | return Result.success(flist); 59 | } catch (Exception e) { 60 | log.error("", e); 61 | return Result.error(Status.ETH_ERROR); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/controller/SponsorController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.base.Result; 4 | import com.example.demo.base.Status; 5 | import com.example.demo.base.Utils; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.springframework.web.multipart.MultipartFile; 12 | import org.web3j.crypto.Credentials; 13 | import org.web3j.crypto.WalletUtils; 14 | import org.web3j.model.CrowdFunding; 15 | import org.web3j.protocol.Web3j; 16 | import org.web3j.tx.gas.DefaultGasProvider; 17 | import org.web3j.utils.Convert; 18 | 19 | import java.math.BigInteger; 20 | 21 | @Slf4j 22 | @Controller 23 | public class SponsorController { 24 | 25 | @Value("${contract.address}") 26 | private String ADDRESS; 27 | 28 | @Autowired 29 | private Web3j web3j; 30 | 31 | @GetMapping("create") 32 | public String create() { 33 | return "/create"; 34 | } 35 | 36 | @PostMapping("create") 37 | @ResponseBody 38 | public Result create(@RequestParam("file") MultipartFile file, @RequestParam("password") String password, 39 | @RequestParam("content") String content, @RequestParam("goal") int goal) { 40 | try { 41 | Credentials credentials = WalletUtils.loadCredentials(password, Utils.StoreTmpFile(file.getBytes())); 42 | CrowdFunding cf = CrowdFunding.load(ADDRESS, web3j, credentials, new DefaultGasProvider()); 43 | cf.create(content, BigInteger.valueOf(goal)) 44 | .sendAsync(); // 异步 45 | return Result.success(""); 46 | } catch (Exception e) { 47 | log.error("", e); 48 | return Result.error(Status.ETH_ERROR); 49 | } 50 | } 51 | 52 | @GetMapping("contribute") 53 | public String contribute() { 54 | return "/contribute"; 55 | } 56 | 57 | @PostMapping("contribute") 58 | @ResponseBody 59 | public Result contribute(@RequestParam("file") MultipartFile file, @RequestParam("password") String password, 60 | @RequestParam("campaignID") int campaignID, @RequestParam("amount") int amount) { 61 | try { 62 | Credentials credentials = WalletUtils.loadCredentials(password, Utils.StoreTmpFile(file.getBytes())); 63 | CrowdFunding cf = CrowdFunding.load(ADDRESS, web3j, credentials, new DefaultGasProvider()); 64 | cf.contribute(BigInteger.valueOf(campaignID), BigInteger.valueOf(amount).multiply(Convert.Unit.ETHER.getWeiFactor().toBigInteger())) 65 | .sendAsync(); // 异步 66 | return Result.success(""); 67 | } catch (Exception e) { 68 | log.error("", e); 69 | return Result.error(Status.ETH_ERROR); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/example/demo/model/Campaign.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.model; 2 | 3 | import lombok.Data; 4 | import lombok.NoArgsConstructor; 5 | import org.web3j.tuples.generated.Tuple6; 6 | import org.web3j.utils.Convert; 7 | 8 | import java.math.BigInteger; 9 | import java.text.SimpleDateFormat; 10 | 11 | @Data 12 | @NoArgsConstructor 13 | public class Campaign { 14 | 15 | private int id; 16 | private String beneficiary; 17 | private String content; 18 | private BigInteger goal; 19 | private BigInteger amount; 20 | private BigInteger numFunders; 21 | private String time; 22 | 23 | public Campaign(Tuple6 tuple) { 24 | this.beneficiary = tuple.component1(); 25 | this.content = tuple.component2(); 26 | this.goal = tuple.component3(); 27 | this.amount = tuple.component4().divide(Convert.Unit.ETHER.getWeiFactor().toBigInteger()); 28 | this.numFunders = tuple.component5(); 29 | this.time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") 30 | .format(tuple.component6().multiply(BigInteger.valueOf(1000))); 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/example/demo/model/Funder.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.model; 2 | 3 | import lombok.Data; 4 | import lombok.NoArgsConstructor; 5 | import org.web3j.tuples.generated.Tuple3; 6 | import org.web3j.utils.Convert; 7 | 8 | import java.math.BigInteger; 9 | import java.text.SimpleDateFormat; 10 | 11 | @Data 12 | @NoArgsConstructor 13 | public class Funder { 14 | 15 | private int id; 16 | private String addr; 17 | private BigInteger amount; 18 | private String time; 19 | 20 | public Funder(Tuple3 tuple) { 21 | this.addr = tuple.component1(); 22 | this.amount = tuple.component2().divide(Convert.Unit.ETHER.getWeiFactor().toBigInteger()); 23 | this.time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") 24 | .format(tuple.component3().multiply(BigInteger.valueOf(1000))); 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/org/web3j/model/CrowdFunding.java: -------------------------------------------------------------------------------- 1 | package org.web3j.model; 2 | 3 | import java.math.BigInteger; 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | import java.util.concurrent.Callable; 8 | import org.web3j.abi.TypeReference; 9 | import org.web3j.abi.datatypes.Address; 10 | import org.web3j.abi.datatypes.Function; 11 | import org.web3j.abi.datatypes.Type; 12 | import org.web3j.abi.datatypes.Utf8String; 13 | import org.web3j.abi.datatypes.generated.Uint256; 14 | import org.web3j.crypto.Credentials; 15 | import org.web3j.protocol.Web3j; 16 | import org.web3j.protocol.core.RemoteCall; 17 | import org.web3j.protocol.core.RemoteFunctionCall; 18 | import org.web3j.protocol.core.methods.response.TransactionReceipt; 19 | import org.web3j.tuples.generated.Tuple3; 20 | import org.web3j.tuples.generated.Tuple6; 21 | import org.web3j.tx.Contract; 22 | import org.web3j.tx.TransactionManager; 23 | import org.web3j.tx.gas.ContractGasProvider; 24 | 25 | /** 26 | *

Auto generated code. 27 | *

Do not modify! 28 | *

Please use the web3j command line tools, 29 | * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 30 | * codegen module to update. 31 | * 32 | *

Generated with web3j version 4.5.11. 33 | */ 34 | @SuppressWarnings("rawtypes") 35 | public class CrowdFunding extends Contract { 36 | public static final String BINARY = "608060405234801561001057600080fd5b506105fe806100206000396000f3fe6080604052600436106100555760003560e01c8063141961bc1461005a5780632c0f7b6f1461013157806346f81a8714610158578063c1cbbca71461020f578063cdff98351461022c578063ff5357ed14610256575b600080fd5b34801561006657600080fd5b506100846004803603602081101561007d57600080fd5b50356102ae565b60405180876001600160a01b03166001600160a01b0316815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b838110156100f15781810151838201526020016100d9565b50505050905090810190601f16801561011e5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561013d57600080fd5b50610146610379565b60408051918252519081900360200190f35b34801561016457600080fd5b5061020d6004803603604081101561017b57600080fd5b81019060208101813564010000000081111561019657600080fd5b8201836020820111156101a857600080fd5b803590602001918460018302840111640100000000831117156101ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061037f915050565b005b61020d6004803603602081101561022557600080fd5b5035610427565b34801561023857600080fd5b506101466004803603602081101561024f57600080fd5b50356104e8565b34801561026257600080fd5b506102866004803603604081101561027957600080fd5b50803590602001356104fd565b604080516001600160a01b039094168452602084019290925282820152519081900360600190f35b600160208181526000928352604092839020805481840180548651600261010097831615979097026000190190911695909504601f81018590048502860185019096528585526001600160a01b03909116949193929091908301828280156103575780601f1061032c57610100808354040283529160200191610357565b820191906000526020600020905b81548152906001019060200180831161033a57829003601f168201915b5050505050908060020154908060030154908060040154908060060154905086565b60005481565b6040805160c0810182523381526020808201858152828401859052600060608401819052608084018190524260a0850152805460018082018355908252808452949020835181546001600160a01b0319166001600160a01b0390911617815590518051939491936103f893928501929190910190610537565b5060408201516002820155606082015160038201556080820151600482015560a0909101516006909101555050565b6000818152600160205260408082208054915190926001600160a01b03909216913480156108fc02929091818181858888f1935050505015801561046f573d6000803e3d6000fd5b50600381018054349081019091556040805160608101825233815260208082019384524282840190815260048601805460018181019092556000908152600590970190925292909420905181546001600160a01b0319166001600160a01b03909116178155915192820192909255905160029091015550565b60009081526001602052604090206004015490565b60009182526001602081815260408085209385526005909301905291208054918101546002909101546001600160a01b0390921692909190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061057857805160ff19168380011785556105a5565b828001600101855582156105a5579182015b828111156105a557825182559160200191906001019061058a565b506105b19291506105b5565b5090565b6105cf91905b808211156105b157600081556001016105bb565b9056fea165627a7a72305820bbd2e477e10e04b4a2f0b3065a47cc9dd2e4c55528cadd118d1daf4bce4f28a00029"; 37 | 38 | public static final String FUNC_CAMPAIGNS = "campaigns"; 39 | 40 | public static final String FUNC_NUMCAMPAIGNS = "numCampaigns"; 41 | 42 | public static final String FUNC_CREATE = "create"; 43 | 44 | public static final String FUNC_CONTRIBUTE = "contribute"; 45 | 46 | public static final String FUNC_NUMFUNDERS = "numFunders"; 47 | 48 | public static final String FUNC_FUNDERS = "funders"; 49 | 50 | @Deprecated 51 | protected CrowdFunding(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 52 | super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); 53 | } 54 | 55 | protected CrowdFunding(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { 56 | super(BINARY, contractAddress, web3j, credentials, contractGasProvider); 57 | } 58 | 59 | @Deprecated 60 | protected CrowdFunding(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 61 | super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); 62 | } 63 | 64 | protected CrowdFunding(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { 65 | super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); 66 | } 67 | 68 | public RemoteFunctionCall> campaigns(BigInteger param0) { 69 | final Function function = new Function(FUNC_CAMPAIGNS, 70 | Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(param0)), 71 | Arrays.>asList(new TypeReference

() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {})); 72 | return new RemoteFunctionCall>(function, 73 | new Callable>() { 74 | @Override 75 | public Tuple6 call() throws Exception { 76 | List results = executeCallMultipleValueReturn(function); 77 | return new Tuple6( 78 | (String) results.get(0).getValue(), 79 | (String) results.get(1).getValue(), 80 | (BigInteger) results.get(2).getValue(), 81 | (BigInteger) results.get(3).getValue(), 82 | (BigInteger) results.get(4).getValue(), 83 | (BigInteger) results.get(5).getValue()); 84 | } 85 | }); 86 | } 87 | 88 | public RemoteFunctionCall numCampaigns() { 89 | final Function function = new Function(FUNC_NUMCAMPAIGNS, 90 | Arrays.asList(), 91 | Arrays.>asList(new TypeReference() {})); 92 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 93 | } 94 | 95 | public RemoteFunctionCall create(String content, BigInteger goal) { 96 | final Function function = new Function( 97 | FUNC_CREATE, 98 | Arrays.asList(new org.web3j.abi.datatypes.Utf8String(content), 99 | new org.web3j.abi.datatypes.generated.Uint256(goal)), 100 | Collections.>emptyList()); 101 | return executeRemoteCallTransaction(function); 102 | } 103 | 104 | public RemoteFunctionCall contribute(BigInteger campaignID, BigInteger weiValue) { 105 | final Function function = new Function( 106 | FUNC_CONTRIBUTE, 107 | Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(campaignID)), 108 | Collections.>emptyList()); 109 | return executeRemoteCallTransaction(function, weiValue); 110 | } 111 | 112 | public RemoteFunctionCall numFunders(BigInteger campaignID) { 113 | final Function function = new Function(FUNC_NUMFUNDERS, 114 | Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(campaignID)), 115 | Arrays.>asList(new TypeReference() {})); 116 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 117 | } 118 | 119 | public RemoteFunctionCall> funders(BigInteger campaignID, BigInteger funderID) { 120 | final Function function = new Function(FUNC_FUNDERS, 121 | Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(campaignID), 122 | new org.web3j.abi.datatypes.generated.Uint256(funderID)), 123 | Arrays.>asList(new TypeReference
() {}, new TypeReference() {}, new TypeReference() {})); 124 | return new RemoteFunctionCall>(function, 125 | new Callable>() { 126 | @Override 127 | public Tuple3 call() throws Exception { 128 | List results = executeCallMultipleValueReturn(function); 129 | return new Tuple3( 130 | (String) results.get(0).getValue(), 131 | (BigInteger) results.get(1).getValue(), 132 | (BigInteger) results.get(2).getValue()); 133 | } 134 | }); 135 | } 136 | 137 | @Deprecated 138 | public static CrowdFunding load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 139 | return new CrowdFunding(contractAddress, web3j, credentials, gasPrice, gasLimit); 140 | } 141 | 142 | @Deprecated 143 | public static CrowdFunding load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 144 | return new CrowdFunding(contractAddress, web3j, transactionManager, gasPrice, gasLimit); 145 | } 146 | 147 | public static CrowdFunding load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { 148 | return new CrowdFunding(contractAddress, web3j, credentials, contractGasProvider); 149 | } 150 | 151 | public static CrowdFunding load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { 152 | return new CrowdFunding(contractAddress, web3j, transactionManager, contractGasProvider); 153 | } 154 | 155 | public static RemoteCall deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { 156 | return deployRemoteCall(CrowdFunding.class, web3j, credentials, contractGasProvider, BINARY, ""); 157 | } 158 | 159 | @Deprecated 160 | public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 161 | return deployRemoteCall(CrowdFunding.class, web3j, credentials, gasPrice, gasLimit, BINARY, ""); 162 | } 163 | 164 | public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { 165 | return deployRemoteCall(CrowdFunding.class, web3j, transactionManager, contractGasProvider, BINARY, ""); 166 | } 167 | 168 | @Deprecated 169 | public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 170 | return deployRemoteCall(CrowdFunding.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, ""); 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /src/main/resources/CrowdFunding.sol: -------------------------------------------------------------------------------- 1 | // https://solidity.readthedocs.io/en/develop/types.html#structs 2 | pragma solidity ^0.5.0; 3 | 4 | contract CrowdFunding { 5 | 6 | struct Funder { 7 | address addr; 8 | uint amount; 9 | 10 | uint time; 11 | } 12 | 13 | struct Campaign { 14 | address payable beneficiary; 15 | string content; 16 | uint goal; 17 | uint amount; 18 | 19 | uint numFunders; 20 | mapping(uint => Funder) funders; 21 | 22 | uint time; 23 | } 24 | 25 | uint public numCampaigns; 26 | mapping(uint => Campaign) public campaigns; 27 | 28 | function numFunders(uint campaignID) public view returns(uint) { 29 | Campaign storage c = campaigns[campaignID]; 30 | return c.numFunders; 31 | } 32 | 33 | function funders(uint campaignID, uint funderID) public view returns(address, uint, uint) { 34 | Funder storage f = campaigns[campaignID].funders[funderID]; 35 | return (f.addr, f.amount, f.time); 36 | } 37 | 38 | function create(string memory content, uint goal) public { 39 | campaigns[numCampaigns++] = Campaign(msg.sender, content, goal, 0, 0, now); 40 | } 41 | 42 | function contribute(uint campaignID) public payable { 43 | Campaign storage c = campaigns[campaignID]; 44 | c.beneficiary.transfer(msg.value); 45 | c.amount += msg.value; 46 | c.funders[c.numFunders++] = Funder(msg.sender, msg.value, now); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | 3 | web3j.url=http://127.0.0.1:8545 4 | credentials.source=C:\\Users\\zhang\\AppData\\Roaming\\Ethereum\\keystore\\UTC--2020-06-09T13-05-38.565951700Z--8048300a95e800124db581b5f8e691e2f0f3bfdf 5 | credentials.password=123456 6 | contract.address=0x8ff1e946612fb830b813bb44492d79555f320ad0 -------------------------------------------------------------------------------- /src/main/resources/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /src/main/resources/templates/contribute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CrowdFunding 6 | 7 | 8 | 9 | 10 | 11 |

CONTRIBUTE

12 |
13 |
14 | 15 |
16 | 18 |
19 |
20 | 21 |
22 | 23 |
24 |
25 | 26 | ETH 27 |
28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 | 40 |
41 | 42 |
43 |
44 | 45 |
46 |
47 | 48 | 49 |
50 |
51 |
52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/templates/create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CrowdFunding 6 | 7 | 8 | 9 | 10 | 11 |

CREATE

12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 | 20 |
21 | 22 |
23 |
24 | 25 | ETH 26 |
27 |
28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 | 37 |
38 | 39 |
40 | 41 |
42 |
43 | 44 |
45 |
46 | 47 | 48 |
49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CrowdFunding 6 | 7 | 8 | 9 | 10 | 11 |
12 |

众筹列表

13 | I Need Help 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
只要人人都献出一点爱,世界将变成美好的人间!
ID内容进度次数地址时间操作
42 | 43 | 80 | 81 | 82 | 146 | 147 | -------------------------------------------------------------------------------- /src/test/java/com/example/demo/ContractDeploy.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.web3j.crypto.Credentials; 7 | import org.web3j.model.CrowdFunding; 8 | import org.web3j.protocol.Web3j; 9 | import org.web3j.tx.gas.DefaultGasProvider; 10 | 11 | @SpringBootTest 12 | class ContractDeploy { 13 | 14 | @Autowired 15 | private Web3j web3j; 16 | 17 | @Autowired 18 | private Credentials credentials; 19 | 20 | @Test 21 | void version() throws Exception { 22 | String version = web3j.web3ClientVersion().send().getWeb3ClientVersion(); 23 | System.out.println(version); 24 | } 25 | 26 | @Test 27 | void deploy() throws Exception { 28 | CrowdFunding contract = CrowdFunding.deploy(web3j, credentials, new DefaultGasProvider()).send(); 29 | System.out.println(contract.getContractAddress()); 30 | // rewrite: contractAddress ----> application.properties 31 | } 32 | } 33 | --------------------------------------------------------------------------------