Skip to content

Instantly share code, notes, and snippets.

View Turupawn's full-sized avatar
🇭🇳
Karaoke veteran

Ahmed Castro Turupawn

🇭🇳
Karaoke veteran
View GitHub Profile
/*
Scroll gas fees are a combination of "L2 execution fees" (on Scroll) and "L1 security fees" (on Ethereum):
totalFee = (l2GasPrice * l2GasUsed) + l1Fee
Where:
- `l2_gas_price` corresponds to the cost of execution on L2
- `l2_gas_used` corresponds to the amount of gas used on L2
- `l1Fee` corresponds to the data availibity and validity proof costs on L1
/*
Fees are calculated as follows (https://community.optimism.io/docs/developers/l2/new-fees.html):
Total transaction fee is a combination of an "L2 execution fee" and an "L1 security fee":
total_fee = (l2_gas_price * l2_gas_used) + (l1_gas_price * l1_gas_used)
Where:
- `l2_gas_price` corresponds to the cost of execution on L2
- `l2_gas_used` corresponds to the amount of gas used on L2
/*
Fees are calculated as follows (https://community.optimism.io/docs/developers/l2/new-fees.html):
Total transaction fee is a combination of an "L2 execution fee" and an "L1 security fee":
total_fee = (l2_gas_price * l2_gas_used) + (l1_gas_price * l1_gas_used)
Where:
- `l2_gas_price` corresponds to the cost of execution on L2
- `l2_gas_used` corresponds to the amount of gas used on L2
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { SchemaResolver } from "@ethereum-attestation-service/eas-contracts/contracts/resolver/SchemaResolver.sol";
import { IEAS, Attestation } from "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
contract AttestationResolver is SchemaResolver, Ownable {
constructor(IEAS eas) SchemaResolver(eas) Ownable() {}
@Turupawn
Turupawn / 01_token.sol
Last active May 18, 2024 05:19
Scroll Workshop
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract SimpleToken is ERC20 {
constructor() ERC20("My Token", "MTK") {
uint initialSupply = 2_000_000_000;
_mint(msg.sender, initialSupply * 1 ether);
}

Installation

1. Metamask

Metamask browser extension.

2. Telegram

For getting Scroll Sepolia funds from a telegram bot.

Install noir v17

Linux

mkdir -p $HOME/.nargo/bin && \
curl -o $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -L https://github.com/noir-lang/noir/releases/download/v0.17.0/nargo-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvf $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -C $HOME/.nargo/bin/ && \
echo -e '\nexport PATH=$PATH:$HOME/.nargo/bin' >> ~/.bashrc && \
source ~/.bashrc

1. Contrato

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

contract Hello
{
 string public hello = "Hola mundo!";
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Hello
{
string hello = "Hola mundo!";
function setHello(string memory _hello) public
{
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "forge-std/Script.sol";
import "../src/rollup/MockRollup.sol";
import {EigenDARollupUtils} from "../src/libraries/EigenDARollupUtils.sol";
contract MockRollupDeployer is Script {
function run() external {
vm.startBroadcast();