New answers tagged

1

This is most likely due to an error with your migration file. Be sure to have a migration file in the migrations folder. You can name it 2_deploy_contract.js : const SportBet = artifacts.require("SportBet"); module.exports = function(deployer) { deployer.deploy(SportBet); }; The truffle-config.js file at the root of your project should look ...


0

in Lottery-test.js file check all the account spelling Thanks me later😜


2

(Answering myself two year later for those arriving here through Google Airlines): "new" keyword is the culprit in this case. Each time "new" is used, the full code of the referenced smart-contract will be included in order to allow to build new SubContract instances at runtime. If just pre-built references are passed, the compiler is ...


0

You cannot create a mapping (or a struct containing a mapping) in memory. So, convert your code from this: contract Campaign { struct Request { string description; uint value; address recipient; bool complete; uint approvalCount; mapping(address => bool) approvals; } Request[] public requests; ...


1

By https://www.trufflesuite.com/docs/truffle/reference/configuration says, set the compile version in truffle.js module.exports = { compilers: { solc: { version: <string>, // A version or constraint - Ex. "^0.5.0" // Can also be set to "native" to use a native solc } } }


0

Solution to get the interface and bytecode: "solc": "^0.8.3", "web3": "^1.3.5" const path = require('path'); const fs = require('fs'); const solc = require('solc'); const inboxPath = path.resolve(__dirname, 'contracts', 'inbox.sol'); const source = fs.readFileSync(inboxPath, 'utf-8'); var input = { language: '...


Top 50 recent answers are included