Releases: polytrade-finance/dual-layer-token
Releases · polytrade-finance/dual-layer-token
Release list
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,subIdBalanceOffunctions. - The new
getSubIdsfunction retrieves all sub-IDs associated with a main ID.
Performance Improvements
setApprovalForAll(operator, approved): Allows the approval or removal ofoperatoras an operator for the caller. Operators can calltransferFromorsafeTransferFromfor any token owned by the caller.safeTransferFrom(sender, recipient, mainId, subId, amount, data): Movesamounttokens fromsendertorecipientusing the allowance mechanism.amountis then deducted from the caller's allowance.approve(spender, mainId, subId, amount): Setsamountas the allowance ofspenderover the caller's tokens.subBalanceOf(account, mainId, subId): Returns the amount of tokens owned by `accountbalanceOfBatch(accounts, mainIds, subIds): Returns the balances of multipleaccountsfor each pair ofmainIdsandsubIds.allowance(owner, spender, mainId, subId): Returns the remaining number of tokens thatspendercan spend on behalf ofownerfor a specificmainIdandsubId.isApprovedForAll(owner, operator): Checks ifoperatoris allowed to manage all of the assets ofowner.
Initial Dual Layer Token Standard
- setApprovalForAll: Approve or remove
operatoras an operator for the caller. - safeTransferFrom: Moves
amounttokens fromsendertorecipient - approve: Sets
amountas the allowance ofspenderover 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
accountin mainId. - subBalanceOf: Returns the amount of tokens owned by
accountin subId. - allowance: Returns the remaining number of tokens that
spenderwill be allowed to spend on behalf ofowner. - isApprovedForAll: Returns if the
operatoris allowed to manage all of the assets ofowner.