Diagnostics · limit
limit[source-size]
The source is empty, or larger than maxSourceBytes (65,536 UTF-8 bytes by default).
Checked first, before anything else. An empty file is never a contract. Larger sources can be allowed for one call with limits: { maxSourceBytes }, up to 16 MiB.
Example
compileSourceAn empty source.
rejected limit[source-size] at 1:1 empty or oversized source
Fix
Provide a contract.
compileSourceCONTRACT Claim {
ENFORCEMENT_MODE: enforced
CONTEXT {
ENTITIES Request {
count: int
region: string
ready: bool
ratio: float
}
CONSTANTS {
zero: int == 0 [SOURCE:POLICY]
cap: int == 25 [SOURCE:POLICY]
}
}
TRIGGER {
grant()
}
GUARANTEE {
ENSURE grant() WHEN Request.ready == true [SOURCE:must_be_ready]
}
PROHIBITION {
FORBID grant WHEN Request.count > cap [SOURCE:over_cap]
}
}accepted
See also: the specification.