Troubleshooting
The following page is full of small nuances and issues that the SKALE team sees frequently along with recommended solutions:
Q: Why are transactions failing in Foundry?
Section titled “Q: Why are transactions failing in Foundry?”When deploying a contract or running a script in Foundry, it’s possible that the Type-2/EIP-1559 transaction can fail.
When this occurs, simply add the --legacy
flag to your CLI command to resolve.
# Before [may fail]forge create ./src/Counter.sol:Counter --private-key <pk> --rpc-url <rpc-url> --broadcast
# Afterforge create ./src/Counter.sol:Counter --private-key <pk> --rpc-url <rpc-url> --broadcast --legacy
Q: Why is my Foundry script failing on a SKALE Chain?
Section titled “Q: Why is my Foundry script failing on a SKALE Chain?”When executing a Foundry script using Forge on a SKALE Chain; it’s possible that many function calls to the chain
can result in failure. With the EVM requiring sequential nocnes, without the --slow
flag; it attempt to send multiple
transactions with the same nonce with results in failure.
# Before [may fail]forge create ./src/Counter.sol:Counter --private-key <pk> --rpc-url <rpc-url> --broadcast
# After [recommended to add the legacy flag as well]forge create ./src/Counter.sol:Counter --private-key <pk> --rpc-url <rpc-url> --broadcast --slow --legacy
Q: Why isn’t my smart contract working?
Section titled “Q: Why isn’t my smart contract working?”The most common issue related to smart contracts either failing to deploy OR reads/writes failing is due to Solidity and VM compiler versions. SKALE runs a slightly modified version of the Ethereum Virtual Machine, built in C++ to enable blazing fast performance, however this does mean that SKALE while EVM compatible is not 1:1 with Ethereum itself.
To ensure that your contract is fully compatible with a SKALE Chain please ensure that you are:
- Using Solidity version <=0.8.24
- Using EVM Compiler <= Shanghai
If you are still having trouble after this, please join the SKALE Developer Success team in Discord for support.