ethereum-attestation-service / eas-contracts

Ethereum Attestation Service https://attest.org
MIT License
245 stars 74 forks source link

attestation.data (un-)packing #113

Closed Caruso33 closed 10 months ago

Caruso33 commented 10 months ago

Hi,

not directly an issue but maybe something to add:

Is there any example how to pack and unpack the attestation.data field?

For example I was trying to add more data to the attest call and use this info in a resolver to call other smart contracts.

https://github.com/Caruso33/Calimocho/blob/7d0485051d3d4c7b2a25f25f1ad5b35db3164fc2/eas-contracts/contracts/CalimochoResolver.sol#L42

Unfortunately, I never got this to run. I think others would also benefit from an example.

Thank you,

Tobias

lbeder commented 10 months ago

Hi @Caruso33, We don't presuppose how the data should be parsed, so it's totally up to you. We do generally recommend encode/decode it as ABI, which you can find for example here: https://github.com/ethereum-attestation-service/eas-contracts-example/blob/master/contracts/ExampleUintResolver.sol

Caruso33 commented 10 months ago

Thanks 🙏🏼 that was the hint I was hoping for.

Somehow I must have overlooked the UintResolver Example.