FAQ: I'm running into the transaction size limit, what can I do?

When sending a large transaction, for example when deploying a large contract, the transaction may fail because it is larger than the size limit.

Consider sending the data in the transaction, for example the contract code, in parts and storing the intermediate progress in storage.

transaction(part: String) {
    prepare(signer: AuthAccount) {
        let path = /storage/temporary
        let existing = signer.load<String>(from: path) ?? ""
        signer.save(existing.concat(part), to: path)