[0.17.1 ] burrow version (docker image tag or branch if built from source)
[ No monax] monax version (if applicable)
[1.9.4 ] go version (if applicable)
[No ducker ] docker version (if applicable)
[Ubuntu 16.04 amd64 ] operating system details (osx/windows/linux)
[ ] steps to reproduction
Burrow's EVM issue :
I did deployed this smart contract on the Burrow, and called the Test method with this parameters 5,6,7
but the result is very different with Remix Ide (Ethereum JavaScript VM)
Here is the issue information :
Smart Contract :
pragma solidity ^0.4.16;
contract ByteCasting {
function Test(int8 _in1, int256 _in2, int16 _in3) public pure
returns(bytes out,int8 _out1, int256 _out2, int16 _out3) {
bytes memory _buff = new bytes(128);
//////////////
// Serializing
uint128 _offst = 128;
int8ToBytes(_offst,_in1,_buff);
_offst -= 1;
int256ToBytes(_offst,_in2,_buff);
_offst -= 32;
int16ToBytes(_offst,_in3,_buff);
_offst -= 2;
out = _buff;
////////////////
// Deserializing
_offst = 128;
_out1 = bytesToInt8(_offst,_buff);
_offst -= 1;
_out2 = bytesToInt256(_offst,_buff);
_offst -= 32;
_out3 = bytesToInt16(_offst,_buff);
_offst -= 2;
}
function int8ToBytes(uint128 _offst, int8 _input, bytes _output) public pure {
assembly {
mstore(add(_output, _offst), _input)
}
}
function int16ToBytes(uint128 _offst, int16 _input, bytes _output) public pure {
assembly {
mstore(add(_output, _offst), _input)
}
}
function int256ToBytes(uint128 _offst, int256 _input, bytes _output) public pure {
assembly {
mstore(add(_output, _offst), _input)
}
}
function bytesToInt8(uint128 _offst, bytes _input) public pure returns (int8 _output) {
assembly {
_output := mload(add(_input, _offst))
}
}
function bytesToInt16(uint128 _offst, bytes _input) public pure returns (int16 _output) {
assembly {
_output := mload(add(_input, _offst))
}
}
function bytesToInt256(uint128 _offst, bytes _input) public pure returns (int256 _output) {
assembly {
_output := mload(add(_input, _offst))
}
}
}
Please include in your bug report:
[0.17.1 ]
burrow version
(docker image tag or branch if built from source)[ No monax]
monax version
(if applicable)[1.9.4 ]
go version
(if applicable)[No ducker ]
docker version
(if applicable)[Ubuntu 16.04 amd64 ] operating system details (osx/windows/linux)
[ ] steps to reproduction
Burrow's EVM issue : I did deployed this smart contract on the Burrow, and called the Test method with this parameters 5,6,7 but the result is very different with Remix Ide (Ethereum JavaScript VM) Here is the issue information :
Smart Contract :
Function call :
Test(5,6,7)
what actually happened: Burrow's output :+1: Burrow-EVM-Issue.txt
"0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000800600 0000000000000000000000000000000000000000000000000000000000000684", "-124", "6", "-32762"
what you expected to happen Remix(Ethereum) output :
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000700 0000000000000000000000000000000000000000000000000000000000000605", "1": "int8: _out1 5", "2": "int256: _out2 6", "3": "int16: _out3 7"