1

Difficulties are as stated above.
Running Truffle v3.5.3, Solidity ^0.8.0, Ganache v2.5.4 local test net.

I have a contract upcomingRace which has the following constructor:

constructor(string memory _race_id, string[12] memory _horses, uint32 _startTime) payable {
        emit initialized(_race_id, address(this));
        emit firstHorseAndStartTime(_horses[0], _startTime);
        emit lastHorseAndStartTime(_horses[11], _startTime);
        race_id = _race_id;
        startTime = _startTime;
        emit startTimeEvent(startTime);
        string memory _horse;
        for (uint i = 0; i < _horses.length; i++){
            _horse = _horses[i];
            horses[_horse] = true;
        }
    }

Declarations of storage variables were omitted for clarity.

I am deploying through the following code:

var upcomingRace = artifacts.require("upcomingRace");

module.exports = function(deployer) {
    deployer.deploy(upcomingRace, '54bE7hU0',[...],1621970217);
};

When migrating a contract with truffle migrate --reset, all the events emitted during instantiation have the expected data. However, when I look at Contracts > upcomingRace in Ganache, clicking inspect gives me the following value,

{
    "name": "startTime",
    "type": "uint",
    "value": "60ad4d29"
  }

which is the correct hex value for the start time. But in the GUI, it reads startTime: uint 61135329 which is obviously not the same as 60ad4d29.

Why does this occur? How can I remedy this? I realize the correct data is there underneath but I'd like to be able to check at a glance

1
  • I'd suggest to report the error in ganache's github. It should be a bug.
    – Ismael
    Jun 4, 2021 at 4:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.