New answers tagged

0

Answering my own question. So, I apparently missed the fact that the abi-encoding function follows the head-tail encoding mechanism. The abi-decoding function then keeps track of the parameter type- actually it checks if the data type has a predefined size, if not, then it treats the value in hand as a start position. Here is a very clear pyethereum ...


0

update @atomh33ls answer use abi.encodePacked pragma solidity ^0.6.0; contract E { uint256 public n; address public sender; function setN(uint256 _n) public { n = _n; sender = msg.sender; } } contract D{ uint256 public n; address public sender; function callSetN(address _e,uint256 _n) ...


0

Yes, it should be possible. But it is not as easy as it sounds. A contract is composed of two things runtime bytecode and internal state. Runtime: It is not that hard to duplicate the runtime bytecode, with some EVM assembly knowledge. Perhaps someone has already done that in github. State: On the other hand is more complicated since it depends on the ...


0

It turns out this was a small issue with EthersJS. The estimated gas is not input correctly. By manually defining the gas limit, it works: myContract.address_to_addresses(<someAddress>, 0, { gasLimit: 60000 }); It's unclear why this is. If I set the gas limit to the actual cost of the function as defined in the abi (1654) then it fails - I have to set ...


Top 50 recent answers are included