Hi @bjamRez
Are you sure accounts[0] has erc20 tokens?
Are you transferring or minting token in that account?
Hi @bjamRez
Are you sure accounts[0] has erc20 tokens?
Are you transferring or minting token in that account?
Sorry, please disregard this issue, I tried it again this morning and it all works fine.
I was not doing things in order but now that I am, I am getting the Big Number and I can also return the result as an integer using either the parseInt or the toNumber functions.
Hmmmā¦ I get this installation warnings even with sudo
command.
But when I wrote npm audit fix
, it says found 0 vulnerabilities.
Iām using node version 15.8.0, npm version 7.9.0 (on MacOS Big Sur)
Hi @REGO350
Warnings are normal and should be ignored.
Type truffle -v
to verify the installation.
Regards,
Dani
Hi Dani,
I am following up your below given instructions but when I call the const res = await instance.getWalletBalance() it says āinstance.getWalletBalance is not a functionā. What is going wrong?
I took out the slashes i put originally in front of SPDX-License-Identifier: MIT
and Iām not getting any errors or red lines.
But the helloworld migration is not working:
[/quote]
Hey there, make sure your config file looks something like this:
compilers: {
solc: {
version: "0.8.3", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
// evmVersion: "byzantium"
// }
}
},
here is what my contract looks like:
pragma solidity 0.8.3;
// SPDX-License-Identifier: MIT
contract Helloworld {
string message = "Hello World Again";
function setMessage(string memory newMessage) public payable { // this setter func; not a view func...makes a transaction to the blockchain
message = newMessage;
}
function hello() public view returns(string memory) {
return message; // this view func makes a call; no transaction
}
}
Iām trying to create the HelloWorld.json file in the build/contracts directory with the truffle compile command but I donāt see any json files besides Migrations.json.
How do I fix this?
This is the hello.sol file
// SPDX-License-Identifier: jessiej
pragma solidity 0.8.0;
contract HelloWorld {
function hello() public pure returns (string memory) {
return "Hello world";
}
}
And this is my 2_hello_migration.js file
const HelloWorld = artifacts.require("HelloWorld");
module.exports = function (deployer) {
deployer.deploy(HelloWorld);
};
Hi,
I am trying to create an instance for the wallet contract but cannot do it. Could you please help me with the following error?
Please note this might be related to the migration of the contract --> when migrating the contract I get this
My migration file is as follows
thank you it worked! Although, I still donāt get the difference between transaction vs call.
My notes from Filip:
truffle(develop)> instance.setMessage.call("Yet a new, new message") // just gets data from the blockchain - no transactions made to the blockchain - - "not comitting anything to the blockchain"
'Yet a new, new message'
// here, truffle actually writes to the blockchain and we now get returned the new message
// this is now a transaction
truffle(develop)> instance.setMessage("new messge6666")
truffle(develop)> instance.hello()
'new messge6666'
Also after Iāve deploy something onto test net is it possible to delete it?
Hello, I would like to know what ā^ā symbol before the version means, and if I need it, thank you. ex: ^0.8.0 .
Also, potential gas consumption?
Hi @inzhagey
From your posts I am not sure if youāve found out what the issue is.
Let me know if you still need assistance.
Cheers,
Dani
You donāt need to create the HelloWorld.json file in the build/contracts because that is created by truffle automatically as soon as you deploy your contract.
The migration file you posted looks correct, therefore I want to be sure you are running the right commands.
truffle develop
;truffle migrate --reset
;Post a screenshot of the results and also your contract code if something fails.
Cheers,
Dani
You cannot delete a contract once it has been deployed.
You could kill it if you coded the function selfdestruct
.
Cheers,
Dani
Hi @Bripeachy
It means that your contract can be compiled with any Solidity 0.8 version (0.8.1, 0.8.4 etc)
Cheers,
Dani
It seams as if truffle should have its own section. I have no idea how to use it and apparently its extremely important to blockchain development. Im trying to read from the website but they dont explain exactly what truffle is they just tell you how to use it. I understand that as a real programmer utilizing a runtime environment is probably 2nd nature to you but you guys cant expect someone with no prior programming experience to understand truffle given only the information provided in this course. Truffle should be an entire course in itself. So now im having to go to another academy to learn truffle so i can understand this course better and even then nobody is explainimg it in the detail that they explain programming using remix. If you guys know of any good readimg materials on truffle please let me know because everything ive found so far dosnt actually explain the basics of truffle they jist assume you already know how to use it and explains the plugins
Hello @dan-i
I have similar issue, tried with your idea, not working yet.
My migration:
const Wallet = artifacts.require("Wallet.sol");
module.exports = function (deployer, accounts) {
address = ["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db"];
uint = 2;
const userAddress = accounts [0,1,2];
deployer.deploy(Wallet, ["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db"], 2 );
};
And this is what I want to send:
await instance.createTransfer(10000, '0xEA1AFdB05fd89c2C61186b28665085F214D25A39' , {from:accounts["0x5B38Da6a701c568545dCfcB03FcB875f56beddC"]})
Is this because in the constructor I added 3 different addresses than which is coming up in truffle when I type in accounts?
Thanks for the help in advance as always.
[/quote]