Closed GaloisField2718 closed 2 years ago
I had tried with another account and it is the same problem. This time I used the README of sputnikdao-factory2 but it's the same error Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error("the account ID is invalid", line: 1, column: 20)', sputnikdao-factory2/src/lib.rs:49:1
.
If it helps I can put complete error.
Moreover the command :
near view marseille.testnet get_dao_list
return this error :
View call: marseille.testnet.get_dao_list() An error occured Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: "panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \"Not all bytes read\" }', /Users/galoisfield/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-4.0.0-pre.7/src/environment/env.rs:688:46" })). { "block_hash": "9R9A5czcVFqD63kXovw3XKEgH6EYN2S35qiv4kyRrWRW", "block_height": 89083343, "error": "wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: \"panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \\"Not all bytes read\\" }', /Users/galoisfield/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-4.0.0-pre.7/src/environment/env.rs:688:46\" }))", "logs": [] } at JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Account.viewFunction (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24) at async exports.callViewFunction (/usr/local/lib/node_modules/near-cli/index.js:94:48) at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) TypedError: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: "panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \"Not all bytes read\" }', /Users/galoisfield/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-4.0.0-pre.7/src/environment/env.rs:688:46" })). { "block_hash": "9R9A5czcVFqD63kXovw3XKEgH6EYN2S35qiv4kyRrWRW", "block_height": 89083343, "error": "wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: \"panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \\"Not all bytes read\\" }', /Users/galoisfield/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-4.0.0-pre.7/src/environment/env.rs:688:46\" }))", "logs": [] } at JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Account.viewFunction (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24) at async exports.callViewFunction (/usr/local/lib/node_modules/near-cli/index.js:94:48) at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) { type: 'UntypedError', context: undefined }
I don't understand why with anank1.testnet I have an empty list (logic, because creation transaction hadn't work) and here I have this error.
Try to put all names in full lowercase
It's the same output....
Failure [anank2.testnet]: Error: {"index":3,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"Encoded text cannot have a 6-bit remainder.\", line: 1, column: 94)', sputnikdao2/src/lib.rs:83:1"}}
ServerTransactionError: {"index":3,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"Encoded text cannot have a 6-bit remainder.\", line: 1, column: 94)', sputnikdao2/src/lib.rs:83:1"}}
at Object.parseResultError (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29)
at Account.signAndSendTransactionV2 (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async scheduleFunctionCall (/usr/local/lib/node_modules/near-cli/commands/call.js:57:38)
at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: 'FunctionCallError',
context: undefined,
index: 3,
kind: {
ExecutionError: Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error("Encoded text cannot have a 6-bit remainder.", line: 1, column: 94)', sputnikdao2/src/lib.rs:83:1
},
transaction_outcome: {
block_hash: 'HVefNWZuh8PVKpMkBrEnpmtXmmDu1RBrZwZ2GaMmrBXT',
id: '9mUQVZUASPWvZx5CYQk8i4ZdRt8WBvWAtqvs5StmniCZ',
outcome: {
executor_id: 'anank2.testnet',
gas_burnt: 2428551533388,
logs: [],
metadata: [Object],
receipt_ids: [Array],
status: [Object],
tokens_burnt: '242855153338800000000'
},
proof: [ [Object], [Object] ]
}
It's this error 'Error("Encoded text cannot have a 6-bit remainder.", line: 1, column: 94)' that I don't understand.
And inside this file sputnikdao2/src/lib.rs:83:1 I found nothing
What's your output in base64 ?
With full lower case : eyJjb25maWciOiB7Im5hbWUiOiAiZ2VuZXNpc2RhbyIsICJwdXJwb3NlIjogIml0IGlzIHRoZSBnZW5lc2lzIGRhbyIsICJtZXRhZGF0YSI6ICJtZXRhZGF0YXMifSwgInBvbGljeSI6IFsibWFyc2VpbGxlLnRlc3RuZXQiLCAibWFyc2VpbGxlMS50ZXN0bmV0IiwiYW5hbmsxLnRlc3RuZXQiLCJhbmFuazIudGVzdG5ldCJdfQo= With regular case like my first post : eyJjb25maWciOiB7Im5hbWUiOiAiZ2VuZXNpc0RBTyIsICJwdXJwb3NlIjogIkl0IGlzIFRIRSBHZW5lc2lzIERBTyIsICJtZXRhZGF0YSI6ICJNZXRhZGF0YXMifSwgInBvbGljeSI6IFsibWFyc2VpbGxlLnRlc3RuZXQiLCAibWFyc2VpbGxlMS50ZXN0bmV0IiwiYW5hbmsxLnRlc3RuZXQiLCJhbmFuazIudGVzdG5ldCJdfQo=
It seems to be the same... it's weird no ?
I try without transforming in base64 but this doesn't work
With this command set : ./build.sh;
export CONTRACT_ID=anank2.testnet;
near deploy $CONTRACT_ID --wasmFile=res/sputnikdao_factory2.wasm --accountId $CONTRACT_ID;
export COUNCIL='["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]';
export ARGS=echo '{"config": {"name": "genesis", "purpose": "It is THE Genesis DAO", "metadata": "Metadatas"}, "policy": '$COUNCIL'}'
;
near call $CONTRACT_ID create "{\"name\": \"genesis\", \"args\": \"$ARGS\"}" --accountId anank2.testnet --amount 10 --gas 150000000000000;
Return :
Starting deployment. Account id: anank2.testnet, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: res/sputnikdao_factory2.wasm
Transaction Id 46VazbeRaBMKG47hJKMff57Fi1ZCxLeMoyE9s1Bbs2i1
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/46VazbeRaBMKG47hJKMff57Fi1ZCxLeMoyE9s1Bbs2i1
Done deploying to anank2.testnet
Scheduling a call: anank2.testnet.create({"name": "genesis", "args": "{"config": {"name": "genesis", "purpose": "It is THE Genesis DAO", "metadata": "Metadatas"}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}"}) with attached 10 NEAR
An error occured
SyntaxError: Unexpected token c in JSON at position 31
at JSON.parse (
And a specifity on the README is to note echo... between this symbol `
I think the problem is linked with the file call.js : /usr/local/lib/node_modules/near-cli/commands/call.js
How can I try function inside call.js ?
Because I think this code : const parsedArgs = options.base64 ? Buffer.from(options.args, 'base64') : JSON.parse(options.args || '{}'); console.log('Doing account.functionCall()'); try { const functionCallResponse = await account.functionCall({ contractId: options.contractName, methodName: options.methodName, args: parsedArgs, gas: options.gas, attachedDeposit: deposit, });
can be a part of problem
do
echo $ARGS
and send it here
I did previously but it's this : eyJjb25maWciOiB7Im5hbWUiOiAiZ2VuZXNpc2RhbyIsICJwdXJwb3NlIjogIml0IGlzIHRoZSBnZW5lc2lzIGRhbyIsICJtZXRhZGF0YSI6ICJtZXRhZGF0YXMifSwgInBvbGljeSI6IFsiYW5hbmsyLnRlc3RuZXQiLCJtYXJzZWlsbGUudGVzdG5ldCJdfQo=
Okey so now try like this {"config": {"name": "genesisdao", "purpose": "it is the genesis dao", "metadata": ""}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}
It's this issue : Starting deployment. Account id: anank2.testnet, node: https://rpc.testnet.near.org/, helper: https://helper.testnet.near.org/, file: res/sputnikdao_factory2.wasm Transaction Id 46VazbeRaBMKG47hJKMff57Fi1ZCxLeMoyE9s1Bbs2i1 To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/46VazbeRaBMKG47hJKMff57Fi1ZCxLeMoyE9s1Bbs2i1 Done deploying to anank2.testnet Scheduling a call: anank2.testnet.create({"name": "genesis", "args": "{"config": {"name": "genesis", "purpose": "It is THE Genesis DAO", "metadata": "Metadatas"}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}"}) with attached 10 NEAR An error occured SyntaxError: Unexpected token c in JSON at position 31 at JSON.parse () at scheduleFunctionCall (/usr/local/lib/node_modules/near-cli/commands/call.js:54:84) at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) SyntaxError: Unexpected token c in JSON at position 31 at JSON.parse () at scheduleFunctionCall (/usr/local/lib/node_modules/near-cli/commands/call.js:54:84) at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
I try : export ARGS =
echo '{"config": {"name": "genesisdao", "purpose": "it is the genesis dao", "metadata": ""}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}'` ?
yes try this export ARGS=`echo '{"config": {"name": "genesisdao", "purpose": "it is the genesis dao", "metadata": ""}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}' | base64`
It tells me bad assignment
yes try this
export ARGS=`echo '{"config": {"name": "genesisdao", "purpose": "it is the genesis dao", "metadata": ""}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}' | base64`
Waaaaaaa !!! It's working !!!!
Thank you so much !! What was wrong ??
I try :
export ARGS =
echo '{"config": {"name": "genesisdao", "purpose": "it is the genesis dao", "metadata": ""}, "policy": ["marseille.testnet", "marseille1.testnet","anank1.testnet","anank2.testnet"]}'` ?
You need write export ARGS=`echo ...
without spaces, in metadata, "Metadatas" wasn't a good input, and your name need to be in lowercase
aw okay ! And just a question where can I find good infos to put inside metadatas ?
THANK YOU THANK YOU THANK YOU 🙏 @ClementMoyal
In the step 6 in the main README.
ExecutionError:
Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error("the account ID is invalid", line: 1, column: 20)', sputnikdao-factory2/src/lib.rs:49:1
Failure [marseille.testnet]: Error: {"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"the account ID is invalid\", line: 1, column: 20)', sputnikdao-factory2/src/lib.rs:49:1"}} ServerTransactionError: {"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"the account ID is invalid\", line: 1, column: 20)', sputnikdao-factory2/src/lib.rs:49:1"}} at Object.parseResultError (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29) at Account.signAndSendTransactionV2 (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async scheduleFunctionCall (/usr/local/lib/node_modules/near-cli/commands/call.js:57:38) at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) { type: 'FunctionCallError', context: undefined, index: 0, kind: { ExecutionError:
Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error("the account ID is invalid", line: 1, column: 20)', sputnikdao-factory2/src/lib.rs:49:1
}, transaction_outcome: { block_hash: 'A2DNdTZgCbHX1GowfeqDjZJpMeftGjsWuknTGs8QtKj4', id: '5PTrtmngBUzkecFP6cmAYjeYuFyVmVzkcWJKhKPQ1vHu', outcome: { executor_id: 'marseille.testnet', gas_burnt: 2428459860094, logs: [], metadata: [Object], receipt_ids: [Array], status: [Object], tokens_burnt: '242845986009400000000' }, proof: [ [Object], [Object], [Object] ] } }I put
And
I don't understand because the two address : "marseille.testnet", "marseille1.testnet" is valid, and it's the same error if I put as in example council-member.testnet, marseille.testnet