Skip to content

Problems with AddressStd #63

Description

@IgorKoval

At the moment AddressStd can be either addr_none$00 or addr_std$10.

See also the address_std on TVM-Solidity.
On TVM-Solidity opcode LDMSGADDR is used to load address_std. The opcode can load an external address. It can cause inconsistent data.

optional(address_std) is encoded as one bit (does it have a value?) and then the address.
Code generated for loading optional(address_std):

	LDI 1
	SWAP
	NULLROTRIFNOT
	PUSHCONT {
		LDMSGADDR
	}
	IF

Code generated for storing optional(address_std):

	ISNULL
	PUSHCONT {
		DROP
		STZERO
	}
	PUSHCONT {
		SWAP
		STONE
		STSLICE
	}
	IFELSE

Proposals:

  1. Support new abi version 2.8.0
  2. AddressStd can take only [addr_std$10]. On Solidity, we use LDSTDADDR opcode
  3. optional(address_std) is serialized as addr_std$10 for null value or addr_std$10. On TVM-Solidity we use just one opcode to encode/decode value: LDOPTSTDADDR/STOPTSTDADDR

Breaking changes:
Old contracts cannot send messages to new ones if:

  1. the old contract used [addr_std$10] for address_std in messages
  2. the old contract used optional(address_std) in messages

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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