Skip to main content

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contracthttps://github.com/trufflesuite/truffle/tree/develop/packages/truffle-contract

buildContracts() {
    let contracts = {};
    let meta;

    this.props.contracts.forEach( _contract => {
      let {contract_name = ''} = _contract;
      meta = contract(_contract);
      meta.setProvider(this.web3Provided.currentProvider);
      meta.defaults({from: this.web3Provided.eth.coinbase});
      contracts[contract_name] = meta;
    });
    return contracts;
  }

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contract

buildContracts() {
    let contracts = {};
    let meta;

    this.props.contracts.forEach( _contract => {
      let {contract_name = ''} = _contract;
      meta = contract(_contract);
      meta.setProvider(this.web3Provided.currentProvider);
      meta.defaults({from: this.web3Provided.eth.coinbase});
      contracts[contract_name] = meta;
    });
    return contracts;
  }

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle/tree/develop/packages/truffle-contract

buildContracts() {
    let contracts = {};
    let meta;

    this.props.contracts.forEach( _contract => {
      let {contract_name = ''} = _contract;
      meta = contract(_contract);
      meta.setProvider(this.web3Provided.currentProvider);
      meta.defaults({from: this.web3Provided.eth.coinbase});
      contracts[contract_name] = meta;
    });
    return contracts;
  }
added 447 characters in body
Source Link
underdog
  • 1.2k
  • 2
  • 12
  • 24

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contract

buildContracts() {
    let contracts = {};
    let meta;

    this.props.contracts.forEach( _contract => {
      let {contract_name = ''} = _contract;
      meta = contract(_contract);
      meta.setProvider(this.web3Provided.currentProvider);
      meta.defaults({from: this.web3Provided.eth.coinbase});
      contracts[contract_name] = meta;
    });
    return contracts;
  }

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contract

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contract

buildContracts() {
    let contracts = {};
    let meta;

    this.props.contracts.forEach( _contract => {
      let {contract_name = ''} = _contract;
      meta = contract(_contract);
      meta.setProvider(this.web3Provided.currentProvider);
      meta.defaults({from: this.web3Provided.eth.coinbase});
      contracts[contract_name] = meta;
    });
    return contracts;
  }
Source Link
underdog
  • 1.2k
  • 2
  • 12
  • 24

Thank's to Truffle Gitter channel I figured out. I have to call defaults function on my truffle-contract's abstraction.

MyContract.defaults({from: …}) 

https://github.com/trufflesuite/truffle-contract