Issue in contract creation using sendRawTransaction?
See original GitHub issueIssue
I am trying to create a new contract using sendRawTransaction().
pragma solidity ^0.4.18;
contract MultiSigWallet {
function MultiSigWallet(address[] _owners) public {
for (uint i = 0; i < _owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
revert();
isOwner[_owners[i]] = true;
}
owners = _owners;
}
/*** Remaining Functions ***/
}
I have array as parameters in my MultiSigWallet contract.
I am using truffle framework for the development.I am trying to get the data param in rawTransaction.For this ,I have written the following code to get the data param in my js.
var MultiSigWallet = contract(MultiSigWallet_artifacts);
var setData = MultiSigWallet.new.getData([adminAddress,fromAddress,toAddress],{
data: MultiSigWallet.unlinked_binary
});
var rawTx = {
"from":fromAddress, //from Address
"data":setData,
"gas":3000000,
"nonce":nonce
}
But it returns the following error:-
(node:15438) UnhandledPromiseRejectionWarning: TypeError: MultiSigWallet.new.getData is not a function
How can I get data
param for contract creation using getData
function?
Expected Behavior
Expects the deployed address for the contract MultiSigWallet
Actual Results
(node:15438) UnhandledPromiseRejectionWarning: TypeError: MultiSigWallet.new.getData is not a function
Environment
- Operating System: Ubuntu 16.04
- Truffle version: Truffle v4.0.5 (core: 4.0.5)
- Ethereum client: Version: 1.8.0-unstable
- node version:v9.3.0
- npm version: 5.6.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Issue with sendRawTransaction for contract Function calls
I have created a sample token contract (https://www.ethereum.org/token#minimum-viable-token) with balanceOf and transfer functions.
Read more >Deploy smart contracts to an Ethereum chain
This tutorial shows you how to deploy smart contracts as transactions to a network. Prerequisites . This tutorial requires a local blockchain ......
Read more >web3.eth — web3.js 1.0.0 documentation - Read the Docs
The web3-eth package allows you to interact with an Ethereum blockchain and Ethereum smart contracts. var Eth = require('web3-eth'); // "Eth.providers.
Read more >Time between web3.eth.sendRawTransaction and transaction ...
I'm making web3py contract transaction, using ...
Read more >Documentation - Ethers.js
Short example of manually creating filters for an ERC-20 // Transfer event. // // Most users should generally use the Contract API to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cgewecke It worked fine…Thank you for your help.
@cgewecke As you mentioned,Shall I try with the following code?