File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/main/kotlin/org/komputing/fauceth Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ dependencies {
2929 implementation " com.github.walleth.kethereum:extensions_transactions:${ KETHEREUM_VERSION} "
3030 implementation " com.github.walleth.kethereum:flows:${ KETHEREUM_VERSION} "
3131 implementation " com.github.walleth.kethereum:rpc:${ KETHEREUM_VERSION} "
32+ implementation " com.github.walleth.kethereum:erc55:${ KETHEREUM_VERSION} "
3233 implementation " com.github.walleth.kethereum:rpc_min3:${ KETHEREUM_VERSION} "
3334 implementation " com.github.walleth.kethereum:model:${ KETHEREUM_VERSION} "
3435 implementation " com.github.walleth.kethereum:crypto:${ KETHEREUM_VERSION} "
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import org.kethereum.crypto.createEthereumKeyPair
1616import org.kethereum.crypto.toAddress
1717import org.kethereum.crypto.toECKeyPair
1818import org.kethereum.eip155.signViaEIP155
19+ import org.kethereum.erc55.isValid
1920import org.kethereum.extensions.transactions.encodeLegacyTxRLP
2021import org.kethereum.model.*
2122import org.kethereum.rpc.HttpEthereumRPC
@@ -85,15 +86,15 @@ fun Application.module() {
8586 val receiveParameters = call.receiveParameters()
8687
8788 val captchaResult: Boolean = verifyCaptcha(receiveParameters[" h-captcha-response" ] ? : " " , hcaptchaSecret)
88- val address = receiveParameters[ADDRESS_KEY ]
89- if (address?.length != 42 ) {
89+ val address = Address ( receiveParameters[ADDRESS_KEY ]? : " " )
90+ if (! address.isValid() ) {
9091 call.respondText(""" Swal.fire("Error", "Address invalid", "error");""" )
9192 } else if (! captchaResult) {
9293 call.respondText(""" Swal.fire("Error", "Could not verify your humanity", "error");""" )
9394 } else {
9495
9596 val tx = createEmptyTransaction().apply {
96- to = Address ( address)
97+ to = address
9798 value = ETH_IN_WEI
9899 nonce = atomicNonce.getAndIncrement()
99100 gasLimit = DEFAULT_GAS_LIMIT
You can’t perform that action at this time.
0 commit comments