Trouble deploying solidity smart contract with "invalid or unexpected token" error - deployment

Trying to replicate a smart contract in a testing environment for practice. When I go to deploy the contract, I am getting "SyntaxError: Invalid or unexpected token". I've had to troubleshoot a few other problems, but can't seem to get past this one. Can anyone help?
2_deploy_contract.js
var Etheremura = artifacts.require("Etheremura");
module.exports = function(deployer) {
deployer.deploy(Etheremura, 0000000000000000000000000D86C54925E12a52a5929c167f20B989F499b3CB7), 000000000000000000000000000000000000000000000000000000000000005f);
};
C:\Users\Rexdog979\eth>truffle migrate
Compiling your contracts...
===========================
√ Fetching solc version list from solc-bin. Attempt #1
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'development'
> Network id: 5777
> Block gas limit: 6721975 (0x6691b7)
2_deploy_contracts.js
=====================
C:\Users\Rexdog979\eth\migrations\2_deploy_contracts.js:4
deployer.deploy(Etheremura, 0000000000000000000000000D86C54925E12a52a5929c167f20B989F499b3CB7), 000000000000000000000000000000000000000000000000000000000000005f);
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at new Script (node:vm:99:7)
at Object.createScript (node:vm:260:10)
at Object.file (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:93:1)
at Migration._load (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:49:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration.run (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:212:1)
at Object.runMigrations (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.run (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:87:1)
at runMigrations (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:258:1)
at Object.run (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:223:1)
at Command.run (C:\Users\Rexdog979\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:147:1)
Truffle v5.3.6 (core: 5.3.6)
Node v16.1.0

You have a redundant closing brace ) after the second argument in the deployer.deploy() function.
It also seems that you're trying to pass an address and an unsigned integer as ABI-encoded values. However, the Truffle deploy() function accepts JS scalars - not the ABI encoded values.
So you could do something like this:
deployer.deploy(
Etheremura,
'0xD86C54925E12a52a5929c167f20B989F499b3CB7', // assuming it's an address
95 // assuming it's an integer, 5f hex == 95 decimal
);

Looking at the deploy function deployer.deploy(Etheremura, 0000000000000000000000000D86C54925E12a52a5929c167f20B989F499b3CB7), 000000000000000000000000000000000000000000000000000000000000005f); you have a unnecessary closing bracket after your address.
Also provide your address like "0xD86C54925E12a52a5929c167f20B989F499b3CB7" and value in the form of an integer. Also make sure that the address you are providing is a valid Ethereum address.

Related

How to add Babel support for nullishCoalescingOperator to vue project?

In my Vue-CLI project, when I tried using the ?? operator, I got this error:
Syntax Error: SyntaxError: /Users/stevebennett/odev/freelancing/v-map/src/components/Map.vue: >Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (30:29):
...
Add #babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.
I installed #babel/plugin-syntax-nullish-coalescing-operator (its name seems to have changed), added it to my babel.config.js:
module.exports = {
presets: ['#vue/app'],
plugins: ['#babel/plugin-syntax-nullish-coalescing-operator'],
};
Now the error message seems to have gone backwards, no reference to the operator name at all:
Module parse failed: Unexpected token (39:35)
You may need an appropriate loader to handle this file type.
| case 8:
| points = _context.sent;
console.log(sheetID ?? 37);
What am I doing wrong?
For me, the #babel/plugin-syntax-nullish-coalescing-operator plugin would not work, which is the one you are using.
I had to use the #babel/plugin-proposal-nullish-coalescing-operator plugin which is the one that the error message suggests you use.
Additionally, I noticed this on the page for the #babel/plugin-syntax-nullish-coalescing-operator plugin:
I can't say for sure if this will fix your problem, but it certainly fixed mine

How to resolve a "Metadata error: chr must be valid" error on Linux?

I am relatively new to the world of coding, so I am having trouble resolving an issue when running TranslocWrapper.pl tutorial_metadata.txt preprocess/ results/ --threads 2. I am trying to run the HTGTS Pipeline according to this GitHub project. This is the full error:
. Library Genome Chr Start End Strand
1 RAG1A_SRep2 hg19 chr11 36594878 36595030 -
Metadata error: chr must be valid at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 285.
main::check_validity_of_metadata('HASH(0x2903ac8)') called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 248
main::read_in_meta_file() called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 90
I have already double-checked the successful installation of the Software Dependencies, so everything should be all good, but I am having trouble interpreting the "Metadata error: chr must be valid at ..." line. If it helps, these are the specific lines that are being called in the error:
TranslocWrapper.pl line 285:
croak "Metadata error: chr must be valid" unless grep { $_ eq $expt->{chr} } #chrlist;
TranslocWrapper.pl line 248:
check_validity_of_metadata($expt);
TranslocWrapper.pl line 90:
read_in_meta_file;
Thanks in advance for the help!
So the error is saying that one of the sequence characters in the metadata file is not present in the sequence's assembly file.
Given that this is the provided example you should assume that the data is correct and your invocation is faulty.
Have you done the TranslocPreprocess.pl preprocessing steps?
If you have try looking at the first line of the metadata file, identify the assembly entry. Ensure that the assembly file exists and that it contains the required sequence.
One common problem with this kind of code is the case of the filenames. The examples are designed to be run in Linux where filename case matters. Windows likes to pretend that case doesn't matter, this can cause problems. If you are running this code from Microsoft Windows or extracted any of the archives from within Windows this is a likely cause of the error.

Error on matlab get_param

I'm generating tlc files from a model. In a specific point I'm getting this error when calling get_param:
>> get_param('FGCS_Sim', 'TargetFcnLibHandle')
??? Error using ==> getTfl at 30 TFL: "None" cannot be found in the
registry.
Error in ==>
C:\MATLAB\R2008b\toolbox\rtw\rtw\#RTW\#TargetRegistry\getTflTableList.p>getTflTableList
at 18
??? Target Function Library 'None' is missing or does not contain a valid TFL Table.
This error is occurring in .p file, so I can't see what's happening. But when I try with a different parameter name (one that does not exist), I get a "normal" error:
>> get_param('FGCS_Sim', 'foo_boo_bar')
??? block_diagram does not have a parameter named 'foo_boo_bar'.
What could be happening?
propose to first check property
'TargetFcnLib'
If that equals 'None' - you will run into the reported error...

How can I generate a Parsing Error in BitBake on intent?

I use Anonymous Python Functions in BitBake recipes to set variables during parsing.
Now I wonder if I can check if a specific variable is set or not. If not, then I want to generate a BitBake Error, which stops the build process.
Pseudo code, that I want to create:
python __anonymous () {
if d.getVar('MY_VARIABLE', True) == "":
<BITBAKE ERROR with custom message "MY_VARIABLE not found">
}
You can call bb.fatal("MY_VARIABLE not set") which will print that error and abort the build by throwing an exception.
Beware that d.getVar() returns None when the variable is unset. You only get the empty string if that's your default value.
Outputs are possible on different loglevels and with python as well as shell script code
For usage in python there are:
bb.fatal
bb.error
bb.warn
bb.note
bb.plain
bb.debug
For usage in shell script there are:
bbfatal
bberror
bbwarn
bbnote
bbplain
bbdebug
for example if you want to throw an error in your recipe's do_install_append function:
bbfatal "something went terribly wrong!"

Arduino HTTPClient not working

I have an Arduino with an Ethernet shield.
I have the httpclient library, and I am trying to run the PachubeClient example.
When I compile, it gives me many errors:
PachubeClient.cpp:25:25: error: Credentials.h: No such file or directory
PachubeClient.cpp: In function 'void setup()':
PachubeClient:47: error: 'ssid' was not declared in this scope
PachubeClient:47: error: 'passphrase' was not declared in this scope
PachubeClient:55: error: a function-definition is not allowed here before '{' token
PachubeClient:95: error: expected `}' at end of input
Why?
I haven't played around with the Arduino development environment at all but that error message means you're either missing the Credentials.h file or the compiler doesn't know where to find it. Verify that the file exists and then check your compiler settings to make sure that you're passing it the path to the header files.