Smart Contract - Testnet Deployment error

Hi all!

I’m trying to deploy a Smart Contract to the testnet but I keep getting errors. If I want to deploy it using the KleverChain IDE it just keeps loading without giving me any feedback.

If I try the transaction using Kleverscan I get the following error: validation error: invalid transaction type. And using the inspector: {“data”:null,“error”:“getting transaction failed: encoding/hex: invalid byte: U+0073 ‘s’”,“code”:“internal_issue”}

I successfully build my contract with the KleverChain IDE and i’m using the generated wasm and ABI files. Can someone help me with this? Thanks in advance.

2 Likes

Hello @Sietse_hoogsteen!

One of the recent changes in the KleverChain Testnet release modified the contractType of smartContract from 99 to 63, which is the reason for this error.

Regarding KleverScan and KleverChain IDE, we are making our best efforts to update them as soon as possible to accommodate this change. We are currently performing some final checks before releasing the update.

3 Likes

Thanks @Nicollas ! I’m looking forward to proceed!

Hello my friend,

We’ve just update the KleverScan Testnet. Could u try use the KleverScan again for SC and let us know if works?

TY

1 Like

It works. Just deployed it! Thanks @Duka !

1 Like

If you mean this with type 99 ?

dataContent: {"type":99,"sender":"klv1dwckxe28pqjvt430nuqernvwxge3h40z40h4yq374zzvd23da0hqm00pw0","nonce":2,"permID":0,"data":["Y3JlYXRlQmV0QDU3Njk3MjY0MjA0MjY5NzQ2MzZGNjk2RTIwNzM3NDY1Njk2NzY1NkUzRg=="],"contract":{"scType":0,"address":"klv1qqqqqqqqqqqqqpgq8rn80m9tzxefcd46yqsu3x7y85qsr7zva0hqxtcz3v","callValue":{}},"contracts":[{"scType":0,"address":"klv1qqqqqqqqqqqqqpgq8rn80m9tzxefcd46yqsu3x7y85qsr7zva0hqxtcz3v","callValue":{}}],"kdaFee":""}
https://node.testnet.klever.finance/
Prepare: {"data":{"result":null,"txHash":""},"error":"validation error: invalid transaction type","code":"bad_request"}

Where in the dotnet package can i find this number? I looked at github and don´t find numbers.

You can find these IDs in this file:
:link: TXContract_ContractType Enum in Contracts.cs

Important:
Make sure you are using version 0.0.9 of dotnet to have the correct smart contract ID.

Hi all!

I have error with deployment, that looks like same:
Error: Command failed: KLEVER_NODE=https://node.testnet.klever.finance /home/try2chng/klever-sdk/koperator --key-file=/home/try2chng/klever-sdk/walletKey.pem sc create --upgradeable --readable --payable --payableBySC --wasm=“/home/try2chng/newtest/first/output/first.wasm” --await
commit: v1.7.7-0-g343a4339-dirty, error: error creating transaction: validation error: invalid transaction type
try adding a --help flag

is it my error or you have some issue and i should just wait?

Hello @_try_again!

I see that your contract was built successfully—nice!

About the deployment:

Until we release the latest version of the IDE, deploying from the extension will fail.

:rocket: Suggested workaround:

Manually deploy your generated WASM file using KleverScan:
:link: Create TransactionSmartContractOperation: Deploy

Let me know if you need any help!

3 Likes

thx for helping!

I need help.
I am trying to send transaction in testnet, but i have to connect wallet with chrome-wallet-extension and it ask me a seed phrase.
But I have only walletKey.pem and some binary files(created with klever VSCode extension).
How can i get seed-phrase from these files or how can I use these files for entry in chrome-wallet-extension? Or how can i create new test-wallet in chrome extension with seed phrase and get some test-coins?

Hello @_try_again In this case, you can import a PEM file into the extension or create a fresh new wallet (which I recommend).

Thank you)


I don’t know how i can import .pem becuase i see only 2 options(create new or import with seed).

I created new wallet and use API to get test-coins.
curl -X POST “https://api.testnet.klever.finance/v1.0/transaction/send-user-funds/(wallet address)”.

And it works)

click on KLV and at the next window go to “Manage Account” and next window at the bottom to “add account”.
there you find the following:

But you must have created/imported one seed before, so the extensions is already usable.