ethereum-attestation-service / eas-contracts

Ethereum Attestation Service https://attest.org
MIT License
252 stars 78 forks source link

Set originator of transaction as attester (#126) #127

Closed aahna-ashina closed 11 months ago

aahna-ashina commented 11 months ago

close #126

aahna-ashina commented 11 months ago

@lbeder Here is our code: https://github.com/nation3/nationcred-contracts/blob/main/contracts/citizens/DeveloperSkillLevels.sol#L103

Each time a DAO member rates the skills of another DAO member, we store an attestation with EAS. And we want the attester address to be the address of the DAO member doing the rating, and not the address of the smart contract.

lbeder commented 11 months ago

Hi @aahna-ashina, Your reasoning is completely understandable, but unfortunately tx.origin is still considered as a bad practice and is unreliable (it has been discussed many times to deprecate it from future EVM versions). I'd recommend you instead to encode the original attester in the data field and use it in the resolver.

aahna-ashina commented 11 months ago

Hi @aahna-ashina, Your reasoning is completely understandable, but unfortunately tx.origin is still considered as a bad practice and is unreliable (it has been discussed many times to deprecate it from future EVM versions). I'd recommend you instead to encode the original attester in the data field and use it in the resolver.

@lbeder What if we don't use a resolver? Is it still possible?

lbeder commented 11 months ago

It depends on your usage, but if you don't use a resolver, yet attest through another contract, you can emit a specific event (if the goal is to detect this offchain) or store a mapping between original attesters and UIDs, but as long as the contract itself makes the attestations - it'll be recorded as the attester.