-
Notifications
You must be signed in to change notification settings - Fork 7
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
Cannot register a delegation for all collections and then query a specific collection #49
Comments
|
Regards to checkConsolidationStatus as its used a predefined use case we have implemented a two way check within the function. Now regards to the retrieveGlobalStatusOfDelegation the intended design was to make it more generic as the usecase is not predefined. Developers can make more than one call to the contract to check the delegation status. Example: Let's say we want to check for delegation status between a vault and the msg.sender on collection 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db for usecase 1. A developer can implement the following function that makes 1 call on the 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db collection and one on the all collections address. example code:
The gas cost for this when called by a contract is just 12553. By expanding the above example you can check for more usecases based on your purpose.
In this case we check the specified collection for usecases 1 and 2 as well as the all collections address for usecases 1 and 2 and the gas cost is just 20k. |
Sure, it's definitely possible to implement logic to call the contract multiple times. However, |
Seems like this issue has come up before. I think the last line in the comment below really shows what I'm after - aiding adoption of this product. |
Problem Statement
I believe that an improvement can be made to querying collections. Right now, if I delegate a wallet to all collections using
0x8888888888888888888888888888888888888888
as the value for_collectionAddress
, I have to query theretrieveTokenStatus
orretrieveGlobalStatusOfDelegation
with0x8888888888888888888888888888888888888888
as the collection address.If I use an actual collection address, I will get back
false
, when I should expect backtrue
. This is broken logic, in my opinion, and should be improved.Potential Solution
The function below should first check against using
0x8888888888888888888888888888888888888888
and the collection address in thehash
and if the logic should returnfalse
, the function should check against the supplied_collectionAddress
.This likely also impacts other retrieve functions as they all follow a similar pattern of creating a hash.
nftdelegation/smart_contracts/DelegationManagement.sol
Line 604 in 50e3d17
The text was updated successfully, but these errors were encountered: