Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan committed Jan 22, 2025
1 parent d5b3d59 commit 56daa7b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,19 @@ pub async fn check_activate(
.data(data)
.value(ONE_ETH);
let state = spoof::code(address, code);
let outs = eth_call(tx, state, provider).await??;
let eth_call_result = eth_call(tx, state, provider).await?;
let outs = match eth_call_result {
Ok(outs) => outs,
Err(e) => {
if e.msg.contains("pay_for_memory_grow") {
let msg = "Contract could not be activated as it is missing an entrypoint. \
Please ensure that your contract has an #[entrypoint] defined on your main struct";
bail!(msg);
} else {
return Err(e.into());
}
}
};
let ArbWasm::activateProgramReturn {
dataFee: data_fee, ..
} = ArbWasm::activateProgramCall::abi_decode_returns(&outs, true)?;
Expand Down

0 comments on commit 56daa7b

Please sign in to comment.