drizzle icon indicating copy to clipboard operation
drizzle copied to clipboard

ContractForm is broken when compile a contract with solidity 0.6

Open nanthanwa opened this issue 5 years ago • 2 comments
trafficstars

ContractForm component works fine with solidity 0.5 but it has an issue when I use with solidity 0.6

Expected Behavior

Can send the data to the blockchain.

Current Behavior

It throws an error

Uncaught TypeError: this.contracts[this.props.contract].methods[this.props.method].cacheSend is not a function
    at c.handleSubmit (drizzle-react-components.js:499)
    at HTMLUnknownElement.callCallback (react-dom.development.js:189)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:238)
    at invokeGuardedCallback (react-dom.development.js:291)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:306)
    at executeDispatch (react-dom.development.js:391)
    at executeDispatchesInOrder (react-dom.development.js:416)
    at executeDispatchesAndRelease (react-dom.development.js:3300)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:3309)
    at forEachAccumulated (react-dom.development.js:3281)
    at runEventsInBatch (react-dom.development.js:3326)
    at runExtractedPluginEventsInBatch (react-dom.development.js:3536)
    at handleTopLevel (react-dom.development.js:3580)
    at batchedEventUpdates$1 (react-dom.development.js:21726)
    at batchedEventUpdates (react-dom.development.js:798)
    at dispatchEventForLegacyPluginEventSystem (react-dom.development.js:3590)
    at attemptToDispatchEvent (react-dom.development.js:4310)
    at dispatchEvent (react-dom.development.js:4231)
    at unstable_runWithPriority (scheduler.development.js:656)
    at runWithPriority$1 (react-dom.development.js:11076)
    at discreteUpdates$1 (react-dom.development.js:21743)
    at discreteUpdates (react-dom.development.js:811)
    at dispatchDiscreteEvent (react-dom.development.js:4210)

Steps to Reproduce

  1. Compiles a contract with solidity 0.6.
  2. Deploy to ganache.
  3. Use ContractForm on react application.
  4. Click "Submit" button

Context (Environment)

Truffle v5.1.21 (core: 5.1.21) Solidity - 0.6.6 (solc-js) Node v12.16.2 Web3.js v1.2.1

nanthanwa avatar Apr 11 '20 17:04 nanthanwa

Solidity 0.6 has a lot of breaking changes and unfortunately we currently don't have the bandwidth to update all our tools to work with it for now. Apologies for the inconvenience caused.

adrianmcli avatar Apr 11 '20 17:04 adrianmcli

I am running into the same issues. I have used OpenZeppelin's implementation of ERC721 contracts, which all use solidity "0.6.2".

I can compile with truffle using the solc compiler with version "0.6.2" and can migrate my contracts, interact with them using the command line and call transactions and everything works smoothly.

But as soon as I try to use the drizzle-react-compnonents, it starts failing, with the cachesend call error. This is so frustrating, i haven't been able to find one clear UI development environment without errors or problems.

srinivasmangipudi avatar May 02 '20 12:05 srinivasmangipudi