Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
questions for finding and squashing bugs in smart contracts and decentralized development
1
vote
Using getStorageAt() on mapping(address => uint64[])
My blog post on the subject has a very similar example: https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/.
Assuming varAddress is correct (doesn't neces …
1
vote
Detecting contact internal transactions
I believe that's roughly correct, and yes, if you only care about interactions that involve ether transfers, you can probably get away with only doing this for blocks in which the contract's balance h …
0
votes
Failing transaction [not out of gas] but error during execution
It looks like you deployed the wrong contract. You deployed MemeRecorder, when I assume you meant to deploy Meme.
(I figured this out by verifying the source code on Etherscan.)
Or perhaps you meant …
3
votes
Accepted
Using address.call.value to send ether from contract to contract in 0.5.0 and above
From https://solidity.readthedocs.io/en/v0.5.7/050-breaking-changes.html#semantic-and-syntactic-changes:
Functions .call(), .delegatecall() and .staticcall() now return (bool, bytes memory) to pro …
2
votes
Accepted
Can a transaction end sucessfully (i.e. not revert state) but some of it's 'traces' run out ...
Yes, this can happen if a CALL is made to another contract. Only a portion of gas is forwarded, and so that call can run out of gas. If the "parent" doesn't revert on the CALL failure, then the main t …
2
votes
Accepted
Get contract bytecode and creator from contract address on Geth console
The bytecode should be accessible via getCode. I'm not aware of an efficient way to find the contract's creator (the originator of the transaction that created the contract). I believe you would have …
1
vote
Execution difference of method call in MainNet vs TestNet
Sorry you fell for this!
NewQuestion was called before you attempted to take the ether.
I believe this is the transaction that did it: https://www.etherchain.org/tx/f1df0e4113cdd8e864235ff2bbd472c98 …
5
votes
How to call function without abi?
Probably the easiest way is just to make your own ABI and then call it like you typically would. Here's an ABI for just this function:
[
{
"constant": true,
"inputs": [
…
4
votes
Accepted
Cannot read property 'contract' of undefined. Node api interacting with smart contract
require('web3') returns a class. You need to instantiate it first. Note the capital W:
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
// (o …
0
votes
minimumBet Appears to be Returning Incorrect Amount
This appears to just be a typo. The screenshot above that text shows the same number of zeroes that you're getting. Try contacting the author of the post to get clarification.
1
vote
How to create a method that calls the remaining tokens in the Escrow contract
Your token interface is missing a definition of balanceOf:
interface token {
function transfer(address receiver, uint amount) public;
// Add this:
function balanceOf(address) public retu …
1
vote
ParserError: Expected pragma, import directive or contract /interface/library definition
You can't compile ABI. The error is because the Solidity compiler is expecting to see Solidity code, but instead it's seeing something else (JSON).
2
votes
Accepted
Issue in insertion to an array inside a struct
Your code looks correct. I tested the following and got a length of 1 as expected:
pragma solidity ^0.4.17;
contract Test {
struct Stonedetails {
uint stoneweight;
string stoneim …
3
votes
Accepted
How to transfer any ERC20 token in Solidity from my smart contract?
This line doesn't make sense:
ERC20Interface(token).approve(msg.sender, amount);
There are two actors in an approve call: the token owner and the token spender.
The token owner calls approve(spend …
0
votes
Accepted
send ether from one contract to another automatically
transfer only forwards a very small amount of gas (2300). This is not enough to make a second transfer.
I believe using call in Client should work as a replacement for transfer:
require(_subCompany. …