Skip to content

Discussion: Add freeze/unfreeze instructions for TVM and Solidity compilers #157

Closed
@Sh11thead

Description

@Sh11thead

Background

As mentioned in #156, there is still a lack of voting in the TVM in relation to DPos and instructions for receiving benefits. The premise of implementing these instructions, while following existing mechanisms, is to achieve an effective set of mechanisms for freezing/unfreezing within the TVM. This would require additional new freeze/unfreeze instructions.

Implementation

To implement Freeze/unfreeze within a virtual machine, one can refer to the existing system contracts, FreezeBalanceContract and UnfreezeBalanceContract.
Therefore, the following two instructions inside the virtual machine can be considered.

  • FREEZEBALANCE, specifying the number of TRXs frozen, the address of the recipient and the type of resource obtained, returns a success or failure flag.

  • UNFREEZEBALANCE, specifying the address and resource type of the unfreeze, the system will recover the resource and unfreeze it, returning a flag of success or failure.

The basic principle that needs to be followed to achieve these two directives is to be consistent with FreezeBalanceContract/UnfreezeBalanceContract to avoid unnecessary risks

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions