Skip to content

bzero(256) compiles to byte 0x00000000000000000... in TEAL, using up a lot of space. #245

@nullun

Description

@nullun

TEALScript

import { Contract } from '@algorandfoundation/tealscript';

class Demo extends Contract {
	@allow.create('NoOp')
	demo(): void {
		const data = bzero(32);
	}
}

TEAL

demo:
	proto 1 0

	// demo.algo.ts:6
	// data = bzero(32)
	byte 0x0000000000000000000000000000000000000000000000000000000000000000
	frame_bury -1 // data: bytes
	retsub

I'd have expected.

demo:
	proto 1 0

	// demo.algo.ts:6
	// data = bzero(32)
	int 32
	bzero
	frame_bury -1 // data: bytes
	retsub

Metadata

Metadata

Assignees

No one assigned

    Labels

    optimizationoptimization on opcode cost, but doesn't change core functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    TODO

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions