Warning Regarding extcodehash in Remix for openzeppelin-contracts - solidity

I have compiled the openzeppelin-contracts code in Remix IDE. Meanwhile, I have obtained the following warning.
Warning: The "extcodehash" instruction is not supported by the VM version "byzantium" you are currently compiling for. It will be interpreted as an invalid instruction on this VM. assembly { codehash := extcodehash(account) }
I am obtaining this warning for all recent versions of the EVM, and not just the byzantium one. I have tried to search for a solution regarding this warning, but without success. Would anyone know how to "fix" this issue?

The issue is that the contract imports from the OpenZeppelin Contracts GitHub master branch which needs a later compiler version.
You should only use code published in an official release of OpenZeppelin Contracts, the latest release is 2.3. When importing via GitHub on Remix you can specify the release tag, (otherwise you will get the latest code in the master branch).
The warning is caused by:
Compiler 0.5.3 has a default EVM version of byzantium whilst Compiler 0.5.11 has a default EVM version of petersburg. You may also want to use Compiler version 0.5.11.
The imports using version 2.3.0 of OpenZeppelin Contracts would be:
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.3.0/contracts/token/ERC721/ERC721Full.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.3.0/contracts/math/SafeMath.sol";
Alternatively to using Remix, have a look at the Getting Started guide for information on how to setup a development environment.
If you have questions on using OpenZeppelin you can ask in the Community Forum: https://forum.openzeppelin.com/
Disclosure: I am the Community Manager at OpenZeppelin

Related

Yarn API alternative to deprecated LogAggregationUtils.getRemoteNodeLogDirSuffix

I've inherited legacy Java code that imports org.apache.hadoop.yarn.logaggregation.LogAggregationUtils class to call LogAggregationUtils.getRemoteNodeLogDirSuffix(Configuration) method. The Hadoop libraries used are in version 2.3.0-cdh5.0.0 and I am trying to port it to version 3.2.2. Unfortunately in version 3.2.2 the getRemoteNodeLogDirSuffix(Configuration) no longer exists. Can anyone suggest a suitable alternative?
I've looked at documentation for version 3.2.2 but I can't see viable candidates https://hadoop.apache.org/docs/r3.2.2/hadoop-yarn/hadoop-yarn-common/apidocs/index.html

what Solidity, solc, web3.js, Ganache versions combination is currently working

What combination of the latest versions of Solidity, solc, web3.js and Ganache is really working at the moment?
I'm trying to use the following:
Solidity ˆ0.8.0
solc ˆ0.8.9
web3.js ˆ1.6.0
ganache-cli ˆ6.1.8
The problem is:
I call a really primitive function to read a public value in my smart contract and I get this error:
"VM Exception while processing transaction: invalid opcode"
I googled and haven't found a working solution. Some answers suggested to change the version of Ganache, that's why I'm trying to find a 'happy' combination of the latest versions.
Maybe, not the latest versions but the ones really working without substantial problems. Have you got any success with it?
Needed to update the version of Ganache to 6.5.0 or higher. This solves the problem.

How to resolve error "Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7..." when building in Android Studio

I've created a new project by checking the "include kotlin" box in Android Studio 3 and out of the box I get an error while compiling
"Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7..."
I have made sure all plugins are up to date and that the Android SDK is properly installed.
How can I solve for this error?
kotlin-stdlib-jre[7/8] was deprecated a while ago, and has since been removed. The deprecation note was kept until 1.2.71, which was the last version to release those artifacts. The official deprecation notice can be found here. Using any of the deprecated versions (before it was removed) should also produce a warning in (at least) Android Studio and IntelliJ.
Use kotlin-stdlib-jdk7 instead. It's the same dependency as kotlin-stdlib-jre7 (except newer), but it was re-named to kotlin-stdlib-jdk. kotlin-stdlib-jre is now no longer maintained as a separate dependency.
Both IntelliJ and Android Studio currently generate new projects using kotlin-stdlib-jre7; this likely is a bug. They have probably not updated the project generators. Therefore, you have to manually replace the dependencies with working ones until they fix this. This is dependent on the Kotlin plugin. Update it if you haven't. I haven't checked whether it's been patched or not - if it has, that only fixes the creation of new projects. For updating from older versions, the rest of the answer still applies
You naturally have to do this if you're on 1.2.71 or lower, and you're upgrading to 1.3.0 or higher.
These are the new valid dependencies as of Kotlin 1.3.0:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Where $kotlinVersion is either a variable containing the version, or a hard-coded version (i.e. 1.3.0)
Alternatively, you can use the "plain" stdlib (kotlin-stdlib) instead of the JDK-specific versions. But you have to change your dependency either way, so I recommend you go with kotlin-stdlib-jdk7, or if you plan on using Java 8, kotlin-stdlib-jdk8
The newest versions of the dependencies can also be found here. jdk7, jdk8, and the version-unspecific stdlib all follow the same versions (as per this edit - this could change in the future, but there'll likely be notices before that change happens), so whether you check jdk8, jdk7 or the regular one, all the versions should be universally available across the stdlib artifacts.
Note for other build systems
The same actual solution applies to other build systems as well, but the code is different. As there are a lot of build systems, I'm not going to include all of them, but the point is changing the artifact from kotlin-stdlib-jre[num] to kotlin-stdlib-jdk[num] (without brackets of course). Or, as mentioned earlier, kotlin-stdlib.
Independently of the build system, this bases itself on access to Maven Central and similar repositories. If your build system doesn't support this, and/or breaks with Maven-style conventions and repositories, you'll have to find what works for your build system.
TL;DR:
Use org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version or org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version (depending on which version you originally used) instead.
Remove this line from the build.gradle:
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
Add this line in the build.gradle:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Update the version build.gradle in project level:
kotlin version='1.3.0'

Compiling Titanium Modules from GitHub

After a few days of failure I realize I need more insight than google can deliver.
I am attempting to include a module in my otherwise working fine Titanium project but am not having any luck. The module in question is Ti.MapPlus, a fork of the standard Ti.Map module that I am already using. The GitHub repository does not have a compiled release, and it is not available via Gitt.io.
I have tried to create a new Mobile Module Project without success; but suspect that this is the best route.
Can anybody walk me through the steps of getting the module working globally?
There are some releases here: https://github.com/AppWerft/Ti.MapPlus/releases

Are SDK's mutually exclusive in an Intellij Module?

I have a mixed scala/python maven module. I primarily do scala development but in order to do some python work I changed the SDK to python.
Now I can not do scala. So is there no way to have both be available? Do I need to manually switch back and forth??
Here is what happened after selecting the python sdk, and attempting to run a scala test class:
UPDATE It appears the situation is worse than anticipated: I can not even switch back to scala at all. Did the project get corrupted??
Here is the error shown in the screenshot:
Error:scalac: error while loading package, Missing dependency 'object java.lang.Object in compiler mirror', required by /Users/steve/.m2/repository/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar(scala/package.class)
If you have a Python facet, you shouldn't select a Python SDK as the SDK to use for your module or project. It only needs to be selected in the facet settings, as your screenshot shows. The project/module SDK needs to be a regular Java/Scala SDK.