pelle / cloth

Simple Ethereum library for Clojure(Script)
142 stars 20 forks source link

encoding of string to bytes for function parameters. #8

Open hookercookerman opened 8 years ago

hookercookerman commented 8 years ago

Apologies for the lose information I have no gone into the depth of the why this is occurring. But I suppose I should read the spec at some point 👍

Test Contract:

pragma solidity ^0.4.0;
contract Test {
    bytes32 public testValue;

    function Test(bytes32 val) {
        testValue = val;
    }
}

create this contract with the parameter: 3071361e-c7db-4602-b568-59d434c7d5ce

it is encoded as

0x333631652d633764622d343630322d623536382d353964343334633764356365 which I believe to be incorrect.

it should be: 0x33303731333631652d633764622d343630322d623536382d3539643433346337 you can check this out in browser-solidity.

cheers

pelle commented 8 years ago

So this is the contract creation transaction you mean?

hookercookerman commented 8 years ago

Not just on constructor call also calling other functions as well

pelle commented 8 years ago

Sorry I've been away. I'll try to investigate more next week.