Closed EmanHerawy closed 11 months ago
I created this repo for this issue
Hi @EmanHerawy,
the forge script
command should be run with the --broadcast --skip-simulation
flags.
--broadcast
the script is not interacting with the chain--skip-simulation
is that the error ActorNotFound()
occurs in the simulation stage of the forge-script because foundry doesn't have access to the builtin-actors that are present in the FVM, and so the call to the Storage Market Actor fails. For this reason, forks will also not work (the example from the README in your repo) - the reason being that only FEVM is forked and not the complete FVM.Additionally, something that can be useful is to check out the fevm-foundry-kit (section about common errors and possible resolutions).
Best of luck in the hackathon! :)
Thanks @bojinovic for your help. I tried to run it with --broadcast --skip-simulation
flags but I got the same result
I am not sure exactly why the forge-script
is doing this, but I suspect it has to do with the Filecoin's Deffered execution model.
As a workaround, you could use forge-create
to deploy the contract and forge-cast
to call the method. Modified contract would look something like this:
contract DealChecker {
function test() public view returns (uint){
dealCheck(137671);
return 1301; //Note: you could unpack and return any value from the `dealCheck` call
}
//Note: this function was modified to be `view`
function dealCheck(uint64 dealId) public view returns(uint64 clientRet, uint64 providerRet, CommonTypes.BigInt memory totalPrice, CommonTypes.FilActorId clientActor , MarketTypes.GetDealDataCommitmentReturn memory commitmentRet) {
commitmentRet = MarketAPI.getDealDataCommitment(dealId);
clientRet = MarketAPI.getDealClient(dealId);
totalPrice = MarketAPI.getDealTotalPrice(dealId);
clientActor = CommonTypes.FilActorId.wrap(clientRet);
providerRet = MarketAPI.getDealProvider(dealId);
}
}
And the commands would be:
forge create DealChecker --rpc-url $CALIBRATIONNET_RPC_URL --private-key $PRIVATE_KEY --gas-limit 1000000000 --evm-version paris
Others
section (example), scroll to the bottom and you will see the "EthAddress" of the deployed contract.cast call <ContractEthAddress> "test()" --rpc-url $CALIBRATIONNET_RPC_URL --private-key $PRIVATE_KEY
Also, be sure to wait longer than the block time between executing those commands - around 1 minute should do the job.
Thank you @bojinovic for highlighting this issue with foundry. I think you are right because I was even unable to ship my contracts with foundry while by moving to hardhat the contracts were deployed and everything went well. Thank you
Hey guys I'm hacking in open data Hack. Whenever I try to check deals from my smart contract I got
ActorNotFound()
error. I create the below test function to make sure it's not related to my logic. What I tried ?getDealClient
,getDealTotalPrice
,getDealProvider
,getDealDataCommitment
] But I got the same error.Unfortunately the error desc is not much helpful and by tracing the code I found
it's throwing in the below function in the return function payload