Releases: polytrade-finance/dual-layer-token
Releases · polytrade-finance/dual-layer-token
Version 1.0.0
Change Log
New Features
- DLTPermit extension has been included, allowing the approval of a spender through message-based signing followingEIP-2612. It involves calling the permit function with signed parameters.
- DLTEnumerable extension has been added to track the amounts in both main IDs and sub-IDs, including
totalMainIds
,totalSubIds
,totalMainSupply
,totalSubSupply
,getSubIds
,subIdBalanceOf
functions. - The new
getSubIds
function retrieves all sub-IDs associated with a main ID.
Performance Improvements
setApprovalForAll(operator, approved)
: Allows the approval or removal ofoperator
as an operator for the caller. Operators can calltransferFrom
orsafeTransferFrom
for any token owned by the caller.safeTransferFrom(sender, recipient, mainId, subId, amount, data)
: Movesamount
tokens fromsender
torecipient
using the allowance mechanism.amount
is then deducted from the caller's allowance.approve(spender, mainId, subId, amount)
: Setsamount
as the allowance ofspender
over the caller's tokens.subBalanceOf(account, mainId, subId)
: Returns the amount of tokens owned by `accountbalanceOfBatch(accounts, mainIds, subIds)
: Returns the balances of multipleaccounts
for each pair ofmainIds
andsubIds
.allowance(owner, spender, mainId, subId)
: Returns the remaining number of tokens thatspender
can spend on behalf ofowner
for a specificmainId
andsubId
.isApprovedForAll(owner, operator)
: Checks ifoperator
is allowed to manage all of the assets ofowner
.
Initial Dual Layer Token Standard
- setApprovalForAll: Approve or remove
operator
as an operator for the caller. - safeTransferFrom: Moves
amount
tokens fromsender
torecipient
- approve: Sets
amount
as the allowance ofspender
over the caller's tokens. - totalSupply: Returns the amount of whole tokens.
- mainTotalSupply: Returns The total supply of all tokens of a given mainId.
- subTotalSupply: Returns The total supply of tokens with a given mainId and subId
- totalMainIds: Returns Total number of unique mainId value.
- totalSubIds: Returns Total number of unique subId values that have been given for a mainId.
- mainBalanceOf: Returns the amount of tokens owned by
account
in mainId. - subBalanceOf: Returns the amount of tokens owned by
account
in subId. - allowance: Returns the remaining number of tokens that
spender
will be allowed to spend on behalf ofowner
. - isApprovedForAll: Returns if the
operator
is allowed to manage all of the assets ofowner
.