Questions tagged [callcode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
60
votes
2answers
19k views

Difference between CALL, CALLCODE and DELEGATECALL

CALL and CALLCODE take the same number of operands (in the execution stack). For the exception flag being pushed on top of the stack: 0 means exception, 1 means successful execution. CALL is easy to ...
7
votes
1answer
140 views

Can a contract know at what position in a callcode an argument begins?

using for example inline assembly with calldatacopy(t, f, s), which copies s bytes from calldata at position f to memory at position t in a call to for example function newContract(bytes data) { ... }...
6
votes
2answers
436 views

What are some ways to decode bytecode?

For example, the withdraw method on WithdrawDAO has methodID 0x3ccfd60b. Given the methodID, could it be decoded to know what method it calls ?
3
votes
1answer
728 views

Callcode | Delegatecall don't work

I was playing around with call, delegatecall and callcode and discovered that the function reset stopped working after I had made a callcode call (here are my actions): FROM JS SIDE: — A.makeCall({...
2
votes
1answer
295 views

Why `address.call` function “saves” unnecessary gas for after the internal execution?

I deployed a contract of a multisig wallet to ropsten and try to test its abilities: https://ropsten.etherscan.io/address/0x8bf20c41ee6a9fd84e81d6f6df872d9628cd08b2 Things that worked fine: Withdraw ...
1
vote
1answer
144 views

Understand an EVM call instruction with gas as 0x00

I am trying to understand the following EVM call instruction generated from here: https://ethervm.io/decompile memory[temp3:temp3 + 0x00] = address(msg.sender).call.gas(0x00).value(var1)(memory[...
1
vote
1answer
626 views

Solidity - selfdestruct

I'm just wondering what would happen if I don't put a selfdestrut() method in my smart contract. As I read from the Solidity documentation (Self-destruct): Even if a contract’s code does not ...
1
vote
1answer
42 views

How to prevent the code of my contract being used in a CALLCODE?

Simple question but I couldn’t find the answer anywhere. How to know if the code of my contract is used in a CALLCODE or DELEGATECALL by third party sinceaddress(this)returns the address of the caller ...
1
vote
1answer
71 views

Is it possible for a smart contract to relay raw signed transaction

I am rethinking the flow for token transfer and confirmation on the network (ERC20,ERC721...). I am unaware of a way presently to: 1- transfer tokens and 2- trigger a call in different contract, ...
1
vote
1answer
450 views

Instantiate a deployed Smart Contract

After deploying a Smart Contract and knowing that: address = 0x20e4ac9385ea45919b9709c2b38d3190efa42ee4 ABI = [{ constant: false, inputs: [], name: "kill", outputs: [],...
1
vote
0answers
21 views

How to get the address of the code being executed from CALLCODE?

I want to write a library which can be callcalled by any contract. As part of this, I want to write a function which returns the contract address of the library to the contract which callcalled it. ...
1
vote
2answers
48 views

Call a smart contract from the protocol level

I am wondering if it is possible to call a function of a smart contract every time a block is mined, perhaps as part of the coinbase transaction? The result of the call would be to send a percentage ...
1
vote
0answers
472 views

abstract way of calling internal function instead of `this.call(callData)`

In Solidity I can call an internal function (inside the same contract that is calling it) the "usual" way: myFunc(); or I can call it via .call, as discussed here or here: callData = bytes4(sha3("...
0
votes
1answer
35 views

Error: Member “func” not found or not visible after argument-dependent lookup in address

I am trying replicate the program given at the following link: What is a function Selector However, I am not using the function selector. I am using the name of the function explicitly to invoke it ...
0
votes
1answer
26 views

How does the network / EVM handle same contract call within same block with same gas?

As an example take the following test contract: pragma solidity ^0.4.24; contract DoubleCall { address public superHero; uint256 public price = 1 ether; function becomeSuperHero() ...
0
votes
0answers
115 views

call wont work in order to update another contract's storage

Storage(variable n) of E won't get updated when I use call from contract D. addressOfE = "0x13fac93069c10e977204b9b64502439740cbe46a"; //Contract E's address that exist on my private chain. call ...
0
votes
1answer
94 views

When using Delegatecall or callcode, which Ether balance is used?

Simple question, but I couldn’t find the answer. When contract A CALLCODE B, B will uses A’s ledger. But which Ether balance will be used if B makes a normal transfer, the balance of A or the balance ...
0
votes
1answer
27 views

When a Callcalled contract calls an other contract normally, who is msg.sender?

If I understand correctly CALLCODE substitute/replace (and not add) the ledger of the target contract with the one the calling contract, isn’t it ? So that when contract Victor CALLCODE Alice, Alice ...