New answers tagged

0

@SanjaySB, truffle-config.js file : require('babel-register'); require('babel-polyfill'); require('dotenv').config(); const HDWalletProvider = require('truffle-hdwallet-provider'); module.exports = { networks: { development: { host: 'localhost', port: 8545, network_id: '*',...


0

Eveything is up to date, there is nothing to compile This means that your contracts have already been compiled and there is no need to recompile them. You can verify this by looking in your build/ directory to verify that your contracts are there. If they are not there, then you have an issue with your deployment script. If this is the case, then you are ...


0

This battery of validity checks requires input parameters, but nothing is said about the deployment methodology. require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); A series of input arguments is laid out in the constructor function: function Crowdsale(...


1

Depending on what you are trying to achieve exactly, there might be another method, using extcodecopy to copy a contract's code. This method would for example allow you to deploy one or several "template" smart contracts on their own, and then build and deploy a separate Deployer contract, which copies code from a template and uses it to deploy a copy. Here'...


0

The pattern suggested by solidity docs for code reuse is using a library. If you abstract away some code into a library, you can then deploy that lib once, and call upon it from your contract. This means, once the library is deployed, that both your factory and the contracts it creates will be smaller to deploy, by about the size of the library each. The ...


0

An excellent question. In short: I don't think this is possible currently. Let's analyze the two scenarios in reverse order: 1) Deployment of Target with new: in order to deploy a new contract we have to have the bytecode somewhere. With existing contracts we only need to use an interface as the bytecode already exists on the blockchain but here we can't ...


1

You are conflating tooling and platform. Truffle is tooling. You don't deploy to truffle, but it can be handy to use truffle to deploy to dev/test and production platforms. Ganache is platform. Regardless of tooling (in your case, a React app), Ganache is a valid platform for dev/test both in terms of cost and in terms of developer productivity. Consider ...


0

It would be possible to use a multisig wallet with a little slight of hand, provided only that the multisig contract can invoke arbitrary functions in other contracts. Since most multisigs cannot, themselves, create a contract, it will need a helping hand. A "Factory" contract could be manually deployed (by anyone/anything) first. It would include the ...


4

It depends. Ethereum is a general-purpose platform and Solidity is an expressive language, so things can potentially work according to arbitrary rules that your developer codifies. That means both intent and quality need to be aligned in your own best interests and the interests of your users. It is challenging to confirm either intent or quality unless ...


1

Actually deploying a contract is not analogous to instantiating an object. Deploying a contract is like publishing your program for the world to see/use. So when you deploy your contract you create a version of it and publish it. The difference is that regular programs are typically available at the same "address" with a new version but deploying the same ...


0

To solve the error you need to pass the arguments of the constructor in your migration file. Based on your two params: // Untested // Deploy a single contract with constructor arguments deployer.deploy(towater, ["string_1", "string_2"], ["0x15458ef540ade6068dfe2f44e8fa733c", "0x15458ef540ade6068dfe2f44e8fa734c"] ); Check the Truffle docs.


1

There is no information about your deployment/testing methodology in the OP. Here's a likely cause. Ganache blockchains are transient. Each time you restart ganache it's a new network with a new network id. Any previous deployments/migrations will not be present. Make it your habit to $ truffle migrate --reset when you restart ganache. You'll see ...


1

EDIT if the contract is not already deployed. Yeah you can totally do that. Just keep that in mind it will cost more gas function bulkAddress(uint256[] _amount, address[] _acct) public { for(uint i = 0; i< _acct.length; i++){ ...your logic } } and can call this function using web3 contractInstance.methods.bulkAddress(...


1

Smart contracts are immutable (code cannot be changed) by design. Truffle and ZeppelinOS are platforms for the development of smart contracts for Ethereum based blockchains. Truffle migrate manages the deployment of contracts to blockchain(s). Each time you migrate a contract you deploy a new instance to a new public address. To use the new smart ...


2

In case of truffle the stored values will not remain in the upgraded contract whereas in proxy approach it is possible to obtain the stored values in the upgraded contract too. In truffle upgrade a new version of contract is being deployed to the network and we will be obtaining a new contract address. If try to console the contract address in migrations ...


2

The EVM bytecode (compiled form) is available/observable to all users at all times. The data in contract states, including variables explicitly marked private, is available/observable to all users at all times. private describes visibility to other contracts but it is a misunderstanding to assume it implies protection for confidential information. ...


Top 50 recent answers are included