#Token contract compiled file soroban_token_contract.wasm is too big.

1 messages · Page 1 of 1 (latest)

frigid thorn
#

Hello, everyone!
I want to deploy a custom token contract to the testnet.
From Soroban examples I compile a token contract:
cargo build --target wasm32-unknown-unknown --release
When I try to deploy it to the test net using the soroban cli I get an error:
error: xdr processing error: xdr value max length exceeded
this error is more informative with python sdk:
ValueError: The maximum length of `value` should be 256000, but got 775087.

So, my compiled soroban_token_contract.wasm size is 775087, which is over the limit.

Please, advise how to correctly compile a token contract to get a valid size and use it in the testnet.

median surge
frigid thorn
median surge
#

no prob! we have all been there 😉

lone mortar
#

Make sure you have turned on

opt-level = 'z'```
in your cargo.toml it can make a big difference sometimes