Reference - http://solidity.readthedocs.io/en/develop/assembly.html
Objective - example of a function returning the contract address.
Code -
pragma solidity ^0.4.18;
contract d4{
function showAddress() view public returns (address addr_v) {
assembly {
addr_v := mload(0x30)
}
}
}
This compiled but just returns 0
.
I used this link for the opcodes - https://github.com/ethereum/pyethereum/blob/develop/ethereum/opcodes.py
Has anyone a code sample of using opcodes to determine the contract address?