filecoin-project / fevm-hardhat-kit

A starter hardhat project for developing, deploying, and testing Solidity smart contracts on the FEVM (Ethereum Virtual Machine on Filecoin)
MIT License
186 stars 83 forks source link

StoreAll fails with hardhat and with Remix #48

Closed joaosantos15 closed 1 year ago

joaosantos15 commented 1 year ago

Hey @ZakAyesh, thank you for these examples, they're a great way to get started with the Filecoin solidity libraries.

I went through the hardhat examples. I was able to deploy the contracts, with yarn hardhat deploy

image

And was also able to run

> yarn hardhat store-all --contract "0xDB986b70919537D70C5034c4721C45d8C15c3316" --dealid 774

With the output

> You have both ethereum-waffle and @nomicfoundation/hardhat-chai-matchers installed. They don't work correctly together, so please make sure you only use one.

We recommend you migrate to @nomicfoundation/hardhat-chai-matchers. Learn how to do it here: https://hardhat.org/migrate-from-waffle
Storing data from FilecoinMarketAPI Getter Functions on network hyperspace
(node:68640) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Complete! Deal Label is 0
✨  Done in 7.14s.

I then imported the contract to Remix (using metamask as the rpc provider) and tried some of the getters, to check that the data from the deal had been stored, but all the values were uninitialised. I also tried running the StoreAll tx through Remix, but got an error with the gas estimation which caused the transaction to hang forever.

Next, I went to https://hyperspace.filfox.info/en/address/0xDB986b70919537D70C5034c4721C45d8C15c3316 to check the state of the contract and noticed that the StoreAll Txs done through hardhat had reverted and the ones through Remix had run out of gas.

image

Any thoughts on how to run the StoreAll tx?

ZakAyesh commented 1 year ago

Hi, thanks for bringing this to our attention! There have been several big updates to the testnets that required updating the underlying Filecoin.sol. The repo now posts to the updated Filecoin.sol and FilecoinMarketConsumer has been updated to match with the new API.

Let me know if it's working for you now! (Please note that deploying via remix is really slow right now so hardhat is probably your best bet).