4

I want to send some ETH to smart contract address

Test.deployed().then(function(instance) {return instance.contribute("0x1e0c326f4f24b5e9f5d42d695f48983d0a72b240", {from:web3.eth.accounts[0],value:10});})

but I always get

truffle(development)> Test.deployed().then(function(instance) {return instance.contribute("0x1e0c326f4f24b5e9f5d42d695f48983d0a72b240", {from:web3.eth.accounts[0],value:10});})
TypeError: instance.contribute is not a function
    at evalmachine.<anonymous>:1:61
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
truffle(development)> truffle(development)>

I am using last version of truffle, so version 4.x

Same problem with

Test.deployed().then(function(instance) {return instance.getElements.call();})

Updated

contract MyContract Common {

  function setMultisigWallet(address newMultisigWallet) public onlyOwner {
    multisigWallet = newMultisigWallet;
  }

  function() external payable {
    executeSale();
  }

}
senzacionale
  • 20,448
  • 67
  • 204
  • 316

1 Answers1

0

Send a transaction directly to a contract via instance.sendTransaction(). This is promisified like all available contract instance functions, and has the same API as web3.eth.sendTransaction but without the callback. The to value will be automatically filled in for you if not specified.

StillFantasy
  • 1,677
  • 9
  • 21