Asset
Last updated
Was this helpful?
Last updated
Was this helpful?
Inherits:
Author: CapSign Inc.
A base contract for representing tokens of an asset with physical (raw) balances only. It does not handle any ratio-based adjustments like splits or dividends.
Sets the name of the token.
Parameters
_name
string
The name of the token.
Sets the prefix of the token.
Parameters
_prefix
string
The prefix of the token.
Creates a brand-new lot (e.g., an initial issuance) for a user.
Parameters
to
address
The owner of the lot.
quantity
uint96
The total raw quantity for this lot.
paymentCurrency
address
The payment currency for this lot.
costBasis
uint96
Raw cost basis per unit.
acquisitionDate
uint64
The original acquisition date.
uri
string
The URI of the lot.
data
bytes
Additional data associated with the lot.
Returns
lotId
bytes32
The unique ID of the new lot.
*Transfers a lot or partial lot from 'from' to 'to', physically/fully (raw).
If the entire lot is transferred, the old lot is invalidated.
If partial, a new lot is created for the remainder.*
Parameters
lotId
bytes32
The ID of the lot to transfer from.
to
address
The new owner.
quantity
uint96
The raw quantity to transfer.
uri
string
The URI of the lot.
data
bytes
Additional data associated with the transfer.
*Transfers a lot or partial lot from 'from' to 'to', physically/fully (raw).
If the entire lot is transferred, the old lot is invalidated.
If partial, a new lot is created for the remainder.*
Parameters
lotId
bytes32
The ID of the lot to transfer from.
from
address
The current owner of the lot.
to
address
The new owner.
quantity
uint96
The raw quantity to transfer.
uri
string
data
bytes
Additional data associated with the transfer.
Creates a new lot as a child of an old lot, typically used for spin-offs, cost basis corrections, partial reclassifications, etc.
Parameters
oldLotId
bytes32
The old lot to be adjusted.
newQuantity
uint96
The raw quantity for the new lot.
newCostBasis
uint96
The raw cost basis for the new lot.
newUri
string
newData
bytes
reason
string
A short string explaining the adjustment type, e.g. "SpinOff", "ManualCorrection".
Returns
newLotId
bytes32
The ID of the newly created lot.
Returns the stored data.
Parameters
lotId
bytes32
The lot ID to query.
Returns
parentLotId
bytes32
Hash of the parent lot, or 0x0 if none.
isValid
bool
Whether the lot is active.
quantity
uint96
The raw quantity.
paymentCurrency
address
The payment currency for this lot.
costBasis
uint96
The raw cost basis.
acquisitionDate
uint64
The original acquisition timestamp (unmodified).
lastUpdate
uint64
The last time this lot was updated.
uri
string
The URI of the lot.
data
bytes
Additional data associated with the lot.
Returns the balance of an owner.
Parameters
owner
address
The owner of the balance.
Returns
<none>
uint256
The balance of the owner.
*Internal function to transfer a lot or partial lot from 'from' to 'to', physically/fully (raw).
If the entire lot is transferred, the old lot is invalidated.
If partial, a new lot is created for the remainder.*
Parameters
lotId
bytes32
The ID of the lot to transfer from.
from
address
The current owner of the lot.
to
address
The new owner.
quantity
uint96
The raw quantity to transfer.
uri
string
data
bytes
Additional data associated with the transfer.
Approve or revoke permission for an operator to manage all of the caller's tokens.
Parameters
operator
address
The address to grant or revoke approval.
approved
bool
True to grant approval, false to revoke.
Returns true if operator
is approved to manage all of owner
's tokens.
Parameters
owner
address
The owner of the tokens.
operator
address
The operator address.
Returns
approved
bool
True if approved, false otherwise.
Approves spender
to manage amount
of a specific lot.
Parameters
lotId
bytes32
The ID of the lot.
spender
address
The address to approve.
amount
uint96
The amount of the lot they can manage.