-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension for asset traits #52
Comments
Thanks @friedger, aligning my traits with this.. One question.. looking at the impl for is-approved and wondering if we do need to pass in a test principle? Ie. if we just want to enforce the tx-sender/contract-caller is either the nft owner or the operator then just the token-id is enough - with an impl like this...
then the Good to know @MarvinJanssen view on this also ? |
The UI might want to call this function with different addresses. Or the contract might implement different rules, like only approved With the address, the api is more open for other use cases. Implementations can ignore the parameter(s). This implementation has one contract approved by default: https://github.com/BTC-Rocks/btc-rocks/blob/main/contracts/btc-rocks.clar#L68 |
👍 @radicleart as an aside:
|
Shall we add |
Could a bulk transfer be managed by another contract with the existing interface and a single user transaction? |
@radicleart bulk transfer could be handled by other contracts, probably it is less efficient. |
I vote to add Edit: thoughts on splitting the bulk transfer functions into a separate trait? I personally think they should be part of the base trait like in SIP013 but I can see arguments in favour of both sides. |
@MarvinJanssen a bulk transfer option that is more generalized might be better ... something that can cover all the nfts without |
There should be a SIP that define extensions that can be implemented by SIP-9 and SIP-10(?) assets. These extension should use the
uint
parameter either as id or as amount.Trait Transferable
This trait is compatible with SIP-9, but not with SIP-10.
The function
transfer-memo
is the corresponding function tostx-transfer-memo?
defined in Stacks 2.1.Example contract: https://github.com/MarvinJanssen/stx-atomic-swap/blob/master/stx/contracts/sip009-sip010-htlc.clar
Trait Operable
This trait should be implemented by transferable asset contracts. It provides functions to defined operators that are approved to transfer assets in the name of the user. Examples of operators are trusted marketplaces.
Security
In #40, some proposals have been made to improve the security of these functions
as-contract?
calls: Trait for Tradables/Marketplace functions #40 (comment)See also radicleart/clarity-market#6
Trait definition
Related Work
https://github.com/radicleart/clarity-market/blob/main/contracts/loopbomb.clar#L195
The text was updated successfully, but these errors were encountered: