Created
November 6, 2024 09:02
-
-
Save Turupawn/c6237e705dc64e472aa35ad23eebda54 to your computer and use it in GitHub Desktop.
Eas test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.23; | |
import { IEAS, AttestationRequest, AttestationRequestData, RevocationRequest, RevocationRequestData } from "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol"; | |
import { NO_EXPIRATION_TIME, EMPTY_UID } from "@ethereum-attestation-service/eas-contracts/contracts/Common.sol"; | |
contract SwapAttestation | |
{ | |
address easAddress = 0xaEF4103A04090071165F78D45D83A0C0782c2B2a; | |
bytes32 schema = 0x27d06e3659317e9a4f8154d1e849eb53d43d91fb4f219884d1684f86d797804a; | |
function swap(address to, bool isFriend) public | |
{ | |
IEAS(easAddress).attest( | |
AttestationRequest({ | |
schema: schema, | |
data: AttestationRequestData({ | |
recipient: to, | |
expirationTime: NO_EXPIRATION_TIME, | |
revocable: true, | |
refUID: EMPTY_UID, | |
data: abi.encode(isFriend), | |
value: 0 // No value/ETH | |
}) | |
}) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment