Erorr on generating solidity event that has 'string indexed' argument
See original GitHub issue- [ v ] I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
The error ‘Error: Number can only safely store up to 53 bits’ is shown when I call contact method that has ‘string indexed hello’ parameter in event. If I remove the ‘indexed’ word then it works fine. Method is called from truffle console
Steps to Reproduce
contract test {
uint _multiplier;
event MultipliedLog(uint indexed a, uint indexed result, string indexed hello, address sender );
function test(uint multiplier){
_multiplier = multiplier;
}
function multiply(uint a) returns(uint d) {
d = a * _multiplier;
MultipliedLog(a, d, "Hello world", msg.sender);
return d;
}
}
truffle(development)> migrate truffle(development)> var c = test.at(test.address) truffle(development)> c.address ‘0x345ca3e014aaf5dca488057592ee47305d9b3e10’ truffle(development)> c.multiply(18)
Expected Behavior
Method call should not fail. It works OK when is called from nethereum (.net c#)
Actual Results
Error: Number can only safely store up to 53 bits at assert (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:228025:21) at BN.toNumber (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:228525:7) at C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:182430:59 at Array.forEach (<anonymous>) at decodeParams (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:182426:9) at Object.decodeEvent (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:182471:10) at C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:317971:38 at Array.map (<anonymous>) at Object.decodeLogs (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:317942:19) at Object.callback (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:318070:35) truffle(development)> test.deployed().then(function(instance){instance.exit SyntaxError: Unexpected end of input at createScript (vm.js:80:10) at Object.runInContext (vm.js:119:10) at Console.interpret (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:200887:17) at ReplManager.interpret (C:\Users\vlukanin\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:201603:18) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:441:10) at emitOne (events.js:116:13) at REPLServer.emit (events.js:211:7) at REPLServer.Interface._onLine (readline.js:282:10)
Environment
- Operating System: Windows 10
- Truffle version: 4.0.1
- Ethereum client: truffle develop. Same issue when using Ganache
- node version: 8.9.1
- npm version: 5.5.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Hopefully I’m not missing something painfully obvious here, especially since this is my first time open source GitHub issuing! Anyway:
Contract
In development console:
Error that runs both through the client and the development console:
Whether I’m running this from the development console or a client, I shouldn’t be getting this error. I should only receive a callback in my event listener for
SendElection()
with either an error or the event. Correct? I know the elections are there by checking the length of the electionsArray I store them in.@v-lukanin Apologies but I’m going to close this again for house-keeping. The error comes from one of our dependencies and is a long-standing issue there. Hopefully there will be a resolution in the future.