Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Last active March 4, 2024 22:01
Show Gist options
  • Save Turupawn/c2c31f1379e2fb5066ecd1750d8e2104 to your computer and use it in GitHub Desktop.
Save Turupawn/c2c31f1379e2fb5066ecd1750d8e2104 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Hello
{
string hello = "Hola mundo!";
function setHello(string memory _hello) public
{
hello = _hello;
}
function getHello() public view returns (string memory)
{
return hello;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract SimpleToken is ERC20 {
constructor(
string memory name,
string memory symbol,
uint256 initialSupply
) ERC20(name, symbol) {
_mint(msg.sender, initialSupply * 1 ether);
}
}

Archivo de configuración

  networks: {
    scrollSepolia: {
      url: "https://scroll-testnet-public.unifra.io/" || "",
      accounts:
        process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
    },
  },

Comando de Deploy

npx hardhat run scripts/deploy.js --network scrollSepolia
//////////////////////////////////////////////////////////////////
//EAS
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
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 EASDemo
{
address easAddress = 0xaEF4103A04090071165F78D45D83A0C0782c2B2a;
bytes32 schema = 0x27d06e3659317e9a4f8154d1e849eb53d43d91fb4f219884d1684f86d797804a;
function sendIsFriend(address to, bool isFriend) public returns(bytes32)
{
return IEAS(easAddress).attest(
AttestationRequest({
schema: schema,
data: AttestationRequestData({
recipient: to,
expirationTime: NO_EXPIRATION_TIME,
revocable: false,
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