owanhunte / ethereum-solidity-course-updated-code Goto Github PK
View Code? Open in Web Editor NEWUp-to-date Solidity / web3.js / Node.js / React / Next.js code for the udemy.com course Ethereum and Solidity: The Complete Developer's Guide.
Up-to-date Solidity / web3.js / Node.js / React / Next.js code for the udemy.com course Ethereum and Solidity: The Complete Developer's Guide.
Currently the latest version of Solidity is 0.7.4
. The purpose of this repo is to provide up-to-date Solidity (and other) code for the benefit of the students enrolled and enrolling in the udemy.com course Ethereum and Solidity: The Complete Developer's Guide and to this end it achieves that goal, that is, all of the updated Solidity code in this repo is fully compatible with version 0.5.0 and higher of Solidity. However if you want to deploy these smart contracts to the Rinkeby Test Network and then work with them without issues, you will need to use ABI and Bytecodes generated by a 0.5.x
version of the Solidity compiler, e.g. 0.5.15
.
I learned this the hard way as I was compiling using the 0.6.0 compiler when I started this repo only to realise that although I had no issue working with the contracts after deploying them to Ganache CLI's local test blockchain, this was not the case after deploying the same compiled bytecodes to Rinkeby, specifically all method calls to the contracts were only returning empty results.
Dear, thank you for the updated code.
In my environment I encounter a problem with the message().call() and the setMessage().call() tests. they fail and the error:
i: VM Exception while processing transaction: invalid opcode
is returned.
Thank you very much in advance for your advice.
Please tell how to connect metamask to the browser.
And Please upload the latest web3.js file attached to this project
Your web3.js file of lottery-react is also not working on my project
First of all, I just wanted to say thank you for picking this up and carrying on @StephenGrider 's fantastic course! I was just curious if you had any plans to update the code/docs to Solidity 0.8.2, or at least cover the breaking changes.
ethereum-solidity-course-updated-code/kickstart/ethereum/compile.js
Lines 49 to 50 in 9f9fc10
I think you can use
const element = contracts[contract];
fs.outputJsonSync(path.resolve(buildPath, `${contract}.json`), element);
Hi Mr Owan, i would like to say the gratitude to you for the update of the course. I would like to ask question on why there are error on retrieving the wallet address in the page index.js
render() {
return <div> {this.props.campaigns[0]}
</div>
}
Thanks in advance.
When following along with the tests covered in section 6, lecture 139, but using more up-to-date smart contract code, you may get the error 'VM Exception while processing transaction: out of gas' when you run the tests.
To resolve this error and get passing tests, change the gas amount from 1000000 (1 million) to a higher value, e.g. 1500000 (1.5 million).
Some stackoverflow responses I found when trying to troubleshoot the error suggested setting a value of 3000000 (3 million) but I found 1.5 million to work fine for me.
Update main README to correctly state the latest version of Solidity, 0.6.3 at this time.
{
"name": "inbox",
"version": "1.0.0",
"description": "",
"main": "compile.js",
"scripts": {
"test": ""
},
"author": "",
"license": "ISC",
"dependencies": {
"solc": "^0.5.15"
}
}
Any ideas?
The error was caused due to the following line of code. I'm using solidity version ^0.8.0 and i was getting that error because requests Array is dynamic and we're trying to access it's index that doesn't even exist.
Request storage r = requests[numRequests++];
fix :
Request storage r = requests.push();
Thanks for detailed explanation btw I got stuck for a while finding the correct version of the code.
Hello, many thanks for providing this repo! Would you be able to explain why you used abi.encodePacked ?
return int256(keccak256(abi.encodePacked(block.difficulty, block.number, players)));
Thanks,
I ran the test but I got the below error:
Error: The contract code couldn't be stored, please check your gas limit.
and also I increase the value of gas but still have this problem.
Transaction: 0x87f1d4bb4f8ed49a504e7f800671184c5725499c383ac0914fc2b0e4a55b3802
Contract created: 0xb2a49b958f35427feba2c22e12ec3180bee82f21
Gas usage: 900000
Block number: 1
Block time: Thu Dec 14 2023 18:12:56 GMT
Runtime error: invalid opcode
First off, thanks for this - really appreciate it. I've recently updated to Solidity 0.8.9 and have been struggling to refactor accordingly. I was initially having issues with compile.js and deploy.js but finally got those sorted thanks to your repo.
However, now when I start up the node server and view in browser, I'm getting a "SyntaxError: Unexpected token u in JSON at position 0" error with regards to factory.js which was a file I haven't touched recently. My factory.js looks like this:
import web3 from './web3';
import CampaignFactory from './build/CampaignFactory.json';
const instance = new web3.eth.Contract(
JSON.parse(CampaignFactory.interface),
'mydeployedfactoryaddress'
);
export default instance;
However, nothing loads any more. I've checked that the factory contract has successfully been deployed to that stated address (with Etherscan) on the Rinkeby network and it has - no issues there. Any idea what might be causing this? Much appreciated!
Hi @owanhunte,
First of all thanks for all your hard work on keeping the course projects up to date.
I'm planning to build all the projects with Typescript. May I use your code as the base?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.