Skip to content

Add example for how to lock balance on the contract #49

@Kaladin13

Description

@Kaladin13

TACT function where the user sends amount_sent and specifies amount_to_lock. The contract should:

Lock exactly amount_to_lock in state
Refund the surplus (amount_sent – amount_to_lock) to the sender after covering all fees (incl. storage rent)

Reference:

      nativeReserve(msg.amount, ReserveExact | ReserveAddOriginalBalance | ReserveBounceIfActionFail);

      message(MessageParameters {
                to: sender(),
                value: 0,
                bounce: false,
                mode: SendRemainingBalance,
            });

Metadata

Metadata

Assignees

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