0

I am using this repo to begin testing UniSwap flash swap contracts. I've installed all dependencies correctly and cleanly.

The project uses ganache-cli, hardhat buidler, and yarn in the terminal and I can use all 3 methods to start up a local chain and I get a different error message with all three. If I use:

ganache-cli -f - Error: VM Exception while processing transaction: revert
buidler node - Error: Transaction reverted: function call to a non-contract account
yarn start-chain - Error: VM Exception while processing transaction: revert UniswapV2: LOCKED

The repo states to use yarn start-chain so I think that's the one to focus on.

This is what I see in Terminal

All contracts have already been compiled, skipping compilation.


  Example

Setting up signer...
  signer: 0x8199Bcbd047e404d6c192969590CB7fCc0CCe2f0

Deploying example contract...
  example contract: 0xEA645fB4c45c22E2E75eD2ABB1fAD9525A7329f8

Testing swap - borrows 1 ETH, paying with ETH

Ensuring that contract can cover fees...
  contract ETH balance 0
  contract will not be able to cover fee, sending from signer...
  signer ETH balance 19228617140000000000
  new contract ETH balance 0

Performing flash swap...
    1) successfully flash swaps


  0 passing (2s)
  1 failing

  1) Example
       successfully flash swaps:
     Error: VM Exception while processing transaction: revert UniswapV2: LOCKED
      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
      at wrapper_1.wrapSend (node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21)
      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
      at wrapper_1.wrapSend (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:23:21)
      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
      at wrapper_1.wrapSend (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:41:21)
      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
      at /Users/justinsacco/TESTcointaker1/uniswap-flash-swapper/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:164:35
      at process._tickCallback (internal/process/next_tick.js:68:7)

Any ideas what might be causing this?

4
  • did you send the Approval to the router? – Nulik Feb 5 at 15:06
  • I think this is being caused because the contract is trying to insert my custom code back into UniSwap's pair contract – travelerr Feb 6 at 13:05
  • did you figure it out? I'm getting the same "Error: Transaction reverted: function call to a non-contract account" – Colin Steidtmann yesterday
  • I did figure this out, and the error was exactly what it says. I forget the why exactly I was thinking this, but what happened was the address I was calling was NOT a contract. However I was running into 3 different errors depending on which command line process I used. I needed to use yarn start-chain with gives me the LOCKED error. Running builder-node was calling something I was not working on. If you can find the solution to the LOCKED error using yarn start-chain let me know – travelerr 11 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.