Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Divide by 0 in gas computation of (concat) #1316

@CryptoPascal31

Description

@CryptoPascal31

Issue description

When using (concat) with an empty list, a divide by 0 error is thrown here:

(fromIntegral nChars * charCost) `div` fromIntegral nStrings

This bug as been introduced in Pact 4.8 by: #1269

Steps to reproduce

pact> (concat [])
""

OK


but:

pact> (env-gasmodel "table")
pact> (env-gaslimit 10000)
"Set gas limit to 10000"
pact> (concat [])
<interactive>:1:0:Error: divide by zero

And of course, the error occurs on-chain too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions