All Questions
Tagged with transactions contract-invocation
123 questions
0
votes
0
answers
192
views
How do I send a transaction to a smart contract?
I need to build this transaction and send it to the blockchain how do I do it ?
I always used ethsendrawTransaction just to send eth but never I never built this type of transaction:
{
"data": [
...
0
votes
2
answers
300
views
How can Contracts sign transactions, when they dont have a private key?
When transactions are made the sender is identified by his signature. But Contracts dont have a private key to sign any transaction or message. So I have some questions:
Can a Contract initiate a ...
1
vote
1
answer
113
views
Where is the position of each paramter in a smart contract function when encoded as inputdata in a transaction
When I reviewed the BEC attack, I found the position of each parameters value in real transaction was not corresponding in to definition of function in smart contract.
The exploit transaction is at:
...
1
vote
1
answer
301
views
Byte32 error, even after converting string to hex
I looked everywhere for people with similar problems, but I couldn't find anything.
I am confused why I keep getting this error (yes, I know others have had this error too, but not for the same ...
1
vote
0
answers
259
views
How to access data from web3.eth.Contracts.send() function?
If I run this chunk of code from my async function I will get a transaction receipt as an output:
const response = await contract.methods.recoverAddr(hex_msg,
v_decimal,r, s).send({from: accounts[0]}...
1
vote
0
answers
74
views
Possibly hacked but not sure Help!
I recently had most ERC20 tokens moved from a MEW wallet through the individual ERC20 contracts. Does anyone know how this may have happened? I am sending pertinent info from one on etherscan.io
1)...
0
votes
1
answer
570
views
from token transaction detail, how can I know if token is actually transferred?
I am implementing support of multiple tokens in my application.
I want to listen new token received transactions.
I got that I need to decode the input data in any transaction to get the toAddress ...
0
votes
1
answer
438
views
Identify whether the recepient of transaction is an external account or a smart contract [duplicate]
I know that an Ethereum transaction addressed to '0x000..000' is creating a new contract. Now, given a transaction address to non-zero address, I want to identify whether it is a transaction to an ...
0
votes
0
answers
43
views
How do i get to return value form one smart contract function into another smart contract on private ethereum network?
Here it is my called function.
pragma solidity ^0.4.19;
contract Called{
string public name;
function set(string _var) {
name = _var;
}
function get() view returns (...
1
vote
1
answer
105
views
What happens when transaction is sent from smart contract?
If during smart contract execution it decides to send a transaction, then transaction would be created, validated and broadcasted to the network from all the nodes executing this smart contract. ...
12
votes
2
answers
7k
views
Does view functions cost gas? And how to send transaction in a proper way?
I have a method defined as:
getNames() view public , if i call on it
contractInstance.getNames.estimatedGas() it returns me a non-zero value, why? I mean, view methods should not consume any gas! On ...
0
votes
1
answer
64
views
Is it safe to assume that a smart contract can hold Ether for years if the withdrawal is not triggered?
Given that ethereum continues to run for few years, is it safe to assume that the smart contract will hold the ether that was deposited into it for years until its triggered to transfer/withdraw the ...
1
vote
2
answers
823
views
How to track incoming to smart contract transactions using web3js?
I've got one Ethereum smart contract which calls functions of the other one. How could I track these calls using web3js or some other tool if it is possible at all? I need it because I want to execute ...
1
vote
0
answers
524
views
How to get transaction hash at time of invoking function?
I have a function as follows:
function setEnergy(address dev, uint256 energy) public returns (bool) {
require(dev != address(0));
amount[dev].energyValue = amount[dev].energyValue + energy;
...
2
votes
1
answer
348
views
tx.origin for factory
I want to use a factory so that people can create a standardized contract. People should be able to transfer money directly by this creation which led me to the problem of the msg.sender during the ...
0
votes
2
answers
212
views
how to loop call token transfer function in a single transaction
I find a transaction here which contains multiple inner transfers. It seems that it saves a lot gas. May I do this with web3j?
1
vote
1
answer
2k
views
How to send data to smart contract?
I have the variable w1_temp, which i need to send to contract
I have the following code:
var W1Temp = require('w1temp')
var Web3 = require('web3')
var web3 = new Web3()
web3.setProvider(new web3....
1
vote
1
answer
7k
views
what is [Reverted] during contract execution
I have sent ETH to a contract address, and it "failed" the transaction saying it is: Warning! Error encountered during contract execution [Reverted]
contract address and transaction failure here:
...
4
votes
1
answer
3k
views
How to send ether to an account instead of creating a smart contract using ethers.js
I would like to send some ether to an account in ropsten testnet. I'm using the following code and the library https://docs.ethers.io/ethers.js/html/. However, instead of sending the ether to the to ...
0
votes
1
answer
148
views
Need Solidity software for smart contract, for Multiple Token dispatch [duplicate]
Please I need to distribute tokens to at least 1,500 wallets and can't go through the stress of sending them one by one.
What I need is a smart contract to enable multiple dispatches to several ...
1
vote
1
answer
93
views
Is gas ultimately *only* sent to miners while the computation defined in a smart contract is performed by each node of the network? [duplicate]
To my understanding, the execution of the code inside a smart contract is done by all nodes in the network. However the miners are the only ones who receive the paid gas. Also, when setting up the ...
1
vote
0
answers
1k
views
How to get all the transactions made by a token address [duplicate]
Given the address of a token, how I can get all the transactions related to that address using JSON RPC or an external api such a api.etherscan.io?
The transactions that gives a Ethereum address are ...
0
votes
1
answer
3k
views
Contract transaction ran out of gas, but the gas limit is much higher than the required amount
We have a smart contract which sends ETH to some address', but everytime we call that function, the function fails..
https://etherscan.io/tx/...
2
votes
2
answers
900
views
How do I deploy a contract, then send and retrieve a string from it?
I wish to store strings on-chain.
From what I understand so far, I need to set up a contract, then I can send transactions (with a string) to that contract which will be stored. Is this the best way ...
3
votes
2
answers
2k
views
Is "transfer" a transaction or a call/message?
I wondered if "transfer()" function is a call or a transaction.
We know contracts only send messages, not transactions.
If a DAO-like contract has a variable and a threshold when the variable ...
1
vote
1
answer
742
views
Do externally owned accounts send messages/transactions do each other? Why doesn't a contract sign its message?
Question 1: Can one account holder send Ether to another one without using a smart contract?
Question 2: Is there any need that two accounts send messages/transaction directly to each other?
a ...
9
votes
3
answers
7k
views
Who pays gas for smart contracts?
I'm currently writing my first smart contract and I'm trying to figure out how to inject gas into the contract, of course, if it's possible.
I'm not sure If I got it correctly. With every transaction ...
2
votes
1
answer
6k
views
How to Deploy and call a contract? Address needed beforehand?
I want to store a string from a script in node.js to blockchain.
This is the contract.
pragma solidity ^0.4.0;
contract SimpleStorage {
string storedData;
function set(string x) {
...
5
votes
1
answer
8k
views
Get pending transactions to a given address/contract
Is there a way I can get all pending transactions to a given address/contract? I could get the confirmed transactions by exploring transactions in recent blocks. But how would I go about getting ...
1
vote
1
answer
336
views
Approval + Deposit each time, vs a one time Approval then only Deposits after
I've noticed that some token contracts are requiring me to do an approval before I make a deposit and some do not.
For example. SNT and CVC do not require me to do an approval before I deposit. ...
3
votes
1
answer
275
views
How can I set the gas price of a transaction initiated by a contract?
I am writing a contract that will interact with another contract: contract A will call a function defined by contract B. Is it possible to set the gas price that contract A is willing to pay when ...
1
vote
2
answers
322
views
What stops an unwanted smart contract from being executed by the receiver
I have searched online about this, but I can't seem to find a real answer.
Say someone sends a smart contract to some address. What if the receiver does not want to accept that contract? How do they "...
3
votes
1
answer
8k
views
Get the balance of an ERC20 token at an Ethereum address [duplicate]
I'm trying to get the balance of a token on an Ethereum address. So let's say my Ethereum address has 1 SNT. I'd like to make a call to get that 1 SNT as a response. I've written many other calls ...
1
vote
1
answer
278
views
Bad Jump Destination, how can i tell programmatically?
Let's say i'm programmatically making a transaction to a contract. How can I tell (programmatically) that the confirmed transaction has a Bad Jump Destination? Right now, the only way I know of is ...
3
votes
2
answers
156
views
Simplest way to find percentage of transactions that invoke EVM?
Firstly I want to make sure my understanding of the Ethereum is correct:
A "normal" transaction of Ether from one account to another does not usually invoke the Ethereum Virtual Machine?
Secondly:
...
3
votes
1
answer
3k
views
How Ethereum contracts transfer Ether without a blockchain confirmation
I would like to understand how Ethereum "messages" (originated from a smart contract) can transfer Ether to another account without a blockchain confirmation.
I have spent several hours ...
1
vote
1
answer
126
views
How to be notified with bad transactions when sending to a JSON-RPC server?
With Ubuntu, I've tried Wallet/Mist and MetaMask on Ropsten testnet: they both notify me with bad transactions before inputting my password. I've tried to do the same thing with a JSON-RPC server, in ...
0
votes
1
answer
63
views
what information is provided to the miner with the transaction
I am wondering what information is provided to the miner with a transaction that needs to invoke a contract?
I thought about Gas, GasPrice, name of function to invoke and input.
But, whether the ...
3
votes
1
answer
566
views
What will happen when an ethereum node loss internet connection?
Will it reconnect to the ethereum network upon establishing internet connection again automatically and sync Data ?
Can we perform transaction and calls on the offline(no internet connection) ...
1
vote
1
answer
527
views
how to retrieve function call address from deployed contract for usage with MetaMask send + transaction data?
I've deployed a contract into my testrpc network.
$ truffle deploy
Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
Migrations: ...
0
votes
1
answer
224
views
Sending parameters via the transaction Object
This works just fine:
myContractObject.doSomething(i, function(err, result) {
if (err) {
console.log(err)
} else {
doSomethingElse(result)
}
})
However, this doesn't:
...
0
votes
1
answer
171
views
How to form the transactionObject in a metamask enforced async call?
Normally, for a contract call (i.e. something that does not update ethereum), I would simply do: var something = myContractObject.getSomething().
I've just started using metamask, and unfortunately, ...
1
vote
1
answer
682
views
How to simulate multiple consecutive transactions and get the resulting state?
I'm trying to simulate a transaction on the public blockchain that invokes a contract's method with certain parameters. Then I want to make a follow-up transaction with some other method call.
I ...
1
vote
1
answer
179
views
Which scope of variables changes the state of the contract?
I had been reading about the state of a smart contract. Here
It also gives a small example of a contract.
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData ...
1
vote
0
answers
115
views
Implementing a reinforced invoice?
I have a question. My contract structure involves 2 user at address A and B respectively:
First A trigger the logging method from the contract with B's address as parameter. This will record a ...
4
votes
1
answer
2k
views
"Estimated fee consuption: The contract won't allow this transaction to be executed." happening in my custom contract in my private network
Any ideas?
My contract:
pragma solidity ^0.4.0;
contract shares {
enum OrderType{BUY,SELL}
struct Order{
address solicitant;
uint price;
uint quantity;
}
...
5
votes
1
answer
4k
views
How to know the hex code to use in data to call a specific contract function?
For instance, on the BAT ico site, you can see the crowdsale contract address, the ABI and also a string to use in the data part of your transaction if you don't want to call the contract function ...
0
votes
1
answer
148
views
Contract killed twice
Due to a delay (not minutes, but hours probably) in mining first a kill transaction https://testnet.etherscan.io/tx/0xf087a137e7f4962260da26928d205cabd71eed68fd79f8f35fb1027073f03812, and minutes ...
5
votes
1
answer
694
views
Is it possible to make several calls in a single transaction?
Suppose your contract has a very simple function, F(), which takes about 1,000 gas to process. Suppose you want to call that function 100 times. Since there is an overhead of about 21,000 gas per ...
3
votes
1
answer
72
views
High level discussion: anomaly monitor
I was reading about past attacks on Ethereum network and I pictured the following hypothetical scenario: there is a tool or automated, machine learning based anomalous monitor to check out constantly ...