//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.24; contract Concater { function concat(bytes32 a, bytes b) public pure returns(bytes result) { uint blen = 32 + b.length; uint blockLen = (blen / 32) * 32; if(blen % 32 > 0) { blockLen += 32; } assembly { let freep := mload(0x40) mstore(0x40, add(freep, blockLen)) mstore(freep, blen) mstore(add(freep, 32), a) calldatacopy(add(freep, 64), 100, sub(blen, 32)) result := freep } } function sampleCallInSameContract(bytes32 msg_hash, bytes sig) public view returns (bytes) { bytes memory hoge = Concater(this).concat(msg_hash, sig); return hoge; } }
0.4.24