ContractOptions
Algorand TypeScript / index / <internal> / ContractOptions
ContractOptions =
object
Defined in: base-contract.ts:41
Additional configuration options for a contract
Properties
Section titled “Properties”avmVersion?
Section titled “avmVersion?”
optionalavmVersion:10|11|12|13
Defined in: base-contract.ts:46
Determines which AVM version to use, this affects what operations are supported. Defaults to value provided on command line (which defaults to current mainnet version)
optionalname:string
Defined in: base-contract.ts:52
Override the name of the logic signature when generating build artifacts. Defaults to the class name
scratchSlots?
Section titled “scratchSlots?”
optionalscratchSlots: (number|NumberRange)[]
Defined in: base-contract.ts:65
Allows you to mark a slot ID or range of slot IDs as “off limits” to Puya.
These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.
This is particularly useful in combination with op.gload_bytes / op.gload_uint64
which lets a contract in a group transaction read from the scratch slots of another contract
that occurs earlier in the transaction group.
In the case of inheritance, scratch slots reserved become cumulative. It is not an error to have overlapping ranges or values either, so if a base class contract reserves slots 0-5 inclusive and the derived contract reserves 5-10 inclusive, then within the derived contract all slots 0-10 will be marked as reserved.
stateTotals?
Section titled “stateTotals?”
optionalstateTotals:StateTotals
Defined in: base-contract.ts:79
Allows defining what values should be used for global and local uint and bytes storage values when creating a contract. Used when outputting ARC-32 application.json schemas.
If left unspecified, the totals will be determined by the compiler based on state
variables assigned to this.
This setting is not inherited, and only applies to the exact Contract it is specified
on. If a base class does specify this setting, and a derived class does not, a warning
will be emitted for the derived class. To resolve this warning, stateTotals must be
specified. An empty object may be provided in order to indicate that this contract should
revert to the default behaviour