Funding transaction failed in pm-scripts/lib/main.js deploy
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
I got this error with node version 8 and version 10, when i was trying to deploy a new prediction market. Everything works ok until the script tried to fund the market.
i traced down the error to function isPlayMoneyToken in /src/utils/tokens.js. The problem is the replace function is called on an object which is not a string.
I will submit a pull request.
Here are the logs:
```
[Gnosis SDK] Approve transfer transaction was mined
[Gnosis SDK] Waiting for funding transaction to be mined, tx hash: 0x8b438a31fbe1de1d4cac7887723ac934d049c69b219dd4112d58dd097b61b9f0
[Gnosis SDK] Error: Funding transaction for market 0x6d8a2806448f9e0d4c204bff89e2f793e3292fe0 failed.
[Gnosis SDK] Are you sure you have enough collateral tokens for funding the market?
[Gnosis SDK] Error: Funding transaction for market 0x6d8a2806448f9e0d4c204bff89e2f793e3292fe0 failed.
```
and
```
TypeError: contractCode.replace is not a function
at _callee$ (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/utils/tokens.js:24:49)
at tryCatch (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at Promise ()
at F (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/core-js/library/modules/_export.js:36:28)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
at isPlayMoneyToken (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/utils/tokens.js:73:17)
at Market._callee3$ (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/markets/index.js:222:53)
at tryCatch (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at
at process._tickCallback (internal/process/next_tick.js:169:7)
false
TypeError: contractCode.replace is not a function
at _callee$ (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/utils/tokens.js:24:49)
at tryCatch (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at Promise ()
at F (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/core-js/library/modules/_export.js:36:28)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
at isPlayMoneyToken (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/utils/tokens.js:73:17)
at Market._callee3$ (/Users/zilanouyang/codes/sandbox/pm-scripts/lib/markets/index.js:229:53)
at tryCatch (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/zilanouyang/codes/sandbox/pm-scripts/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at
at process._tickCallback (internal/process/next_tick.js:169:7)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.