Bonds
What is a Bond?
The Bonds Layer adds functionality for backing individual items with fungible tokens that can be released at a certain time point, or when an item is consumed or destroyed.
Table Breakdown
Table Name: bonds
Table Scope: serial
Field Name
Field Type
Description
backed_amount
asset
5.0000 TLOS
release_event
name
Event name containing release time (blank means no release event)
locked
bool
Prevents changes to backing if true
If a Bond has no release event then the Bond can only be released when the item is consumed or destroyed.
Create a Bond
To create a new Bond call the newbond()
action. This will draw tokens from the group manager's account balance to fund the bond.
Required Auth: group.manager
Action Parameters
Name
Type
Example
Description
serial
uint64_t
3
Serial number of item.
amount
asset
50.0000 TLOS
Amount of tokens to back item with.
release_event
name
releasetime
Name of event that contains release time (optional)
Examples
Add to a Bond
To add to an existing Bond call the addtobond()
action. This allows a bond to be "topped up" with additional funds. Like with newbond()
this action will draw tokens from the manager's account.
Required Auth: group.manager
Action Parameters
Name
Type
Example
Description
serial
uint64_t
amount
Serial number of item.
amount
asset
5.0000 TLOS
Amount of tokens to add to bond.
Bond that have been locked cannot be topped up.
Examples
Release Bond
The release() action can be called to release backed funds from an item if the defined release event time has been reached or exceeded.
Required Auth: contract
Action Parameters
Name
Type
Example
Description
serial
uint64_t
3
Serial number of item with Bond to release.
Examples
Lock Bond
Bonds can be locked to prevent altering the backed amount.
Required Auth: group.manager
Action Parameters
Name
Type
Example
Description
serial
uint64_t
3
Serial number of item with bond to lock.
Examples
Last updated