My team and I are developing a comprehensive smart contract on the Concordium platform.
We are at the stage, where we wanted to deploy to the testnet. However, our smart contract size is ~150 kb, which is too large for the limit of ~65 kb.
Therefore, we tried to follow recommended steps to minify wasm, like using:
wasm-strip
wasm-opt
removing unwrap and vec.push panics through rewriting our code and making a unwrap_abort function, that calls trap() instead
using profile.release opt-levels
Though we can’t seem to get under ~98 kb, without removing essential third-party libraries like k256.
Any ideas/help of what we can do from here are appreciated!
We are considering attempting to split our contract in 2 or figure out if its possible to depend less on the library, though this is far from ideal.
First of all,
The upcoming release will include a new version of the smart contracts where the size is not constrained to 65 kb.
Further the new version of smart contracts will also support sync-calls for inter-communication between smart contracts.
Currently given your already taken actions and without looking at your current contract then I believe your best option right now would indeed be to split up your contract into multiple ones.
In the upcoming release we will also support sync calls which will suspend the execution of the calling contract and resume again when the called one has terminated.
You can look at the new-contract-state branch for an example: